Wavelets/pv

From RawPedia
Jump to navigation Jump to search
NOTE: this is a work in progress



Wavelet Levels

How is this tool organized?

The Wavelet Levels tool is extensive and its underlying algorithms are complex. It has most of the functions necessary for processing photographs from start to finish with the exception of certain tasks such as interpolation or color management. However, it is most useful when it is used to complete or refine processing operations carried out in other parts of RawTherapee.

The tool is organized around a general Wavelet Settings module followed by a series of modules which can activated or deactivated to perform specific tasks.

What are Wavelets?

A Wavelet, or more precisely a Wavelet Transform, is a complex mathematical function which is very useful in image processing.It allows you to split images into several levels of detail so that you can work on the level that interests you.

The wavelets term was introduced in the early 1980s by French physicists Jean Morlet and Alex Grossman: they used the French word ondelette, which means small wave. Later, this word was adapted to English changing onde by wave, leading to wavelet.

The Wavelet Transform, which is similar to a Fourier Transform, represents data as combinations of known and predefined waves (the frequencies), so that the result is as close as possible to the original data. Broadly speaking, the main difference for two-dimensional images is that in the Wavelet Transform the data being analyzed is represented as the frequencies present at the pixel level of the image, whereas in the standard Fourier Transform the data represents the frequencies present in the full image. Therefore, using wavelets offers more precision when analyzing the data.   [Obviously this is a very simplistic explanation: mathematicians would surely have a lot to say here...]

Graphic rendering of a Daubechies wavelet

RawTherapee uses wavelets in various tools, and in this one in particular it uses the Daubechies wavelet, to decompose the elements of the image into the components of the L*a*b* color space (L*, a* and b*).

Image decomposition is carried out using an algorithm to analyze the «internal» contrast of groups of pixels (2x2=4 pixels on the first level, 4x4=16 pixels on the second level, ...) in three directions: vertical, horizontal and diagonal. This analysis converts these contrast values into sets of wavelets with different amplitudes and intensities and stores their characteristics in coefficient matrices, which indicate how the wavelets should be combined to regenerate an image as close as possible to the original.

Each time you make modifications (contrast, tone, noise, ...) this regeneration is done automatically and interactively, so that you can immediately see the result of your adjustments.

In fact the moment the image is decomposed, it ceases to exist leaving only sets of coefficients (one set for each level) which will be used subsequently by the tool. These coefficient sets can be used to characterize the image in the following two ways:

  • Several levels of detail: the first level corresponds to details with an area of 2x2 pixels; the tenth level corresponds to «details» with an area of 1024x1024 pixels. The choice of how many you use depends on your needs, however keep in mind that processing time and memory requirements will increase with the number of levels.
Because only variations (gradients, or differences) in hue or luminance are analyzed at each level, the levels will not contain any information if an image is absolutely uniform in luminance and color. In this case any differences extracted from individual levels will come from digital noise and changes in contrast (or chromaticity) due to edge effects, fog or other scene-related optical phenomena.
  • A residual image: the result of removing the details from all of the decomposed levels of the original image. Consequently, any modifications (contrast, chromaticity etc.) that are carried out within a particular level will have no effect on the residual image and vice versa.

Moreover, for each level the tool takes into account the set of coefficient values and calculates their arithmetic mean (for each level the mean will be different) and the standard deviation. By adding the maximum and minimum coefficients to this data, a characteristic distribution curve is generated for each level (it should be noted that this curve is not Gaussian). This information is used in different ways in the various algorithms used by the wavelet levels tool.

In practice

After decomposition, the resulting levels can be used for different purposes: image compression, noise reduction, secret watermarking, specific residual image treatment for astronomy, etc.

Depending on your needs, you can work either with an individual level of detail, with several levels of detail (one after another), with the residual image, or with all of them combined.

The size of the details included in each level is:

Comparison of actual detail size at each level
1 (Finest) : 2x2 pixels
2 : 4x4 pixels
3 : 8x8 pixels
4 : 16x16 pixels
5 : 32x32 pixels
6 : 64x64 pixels
7 : 128x128 pixels
8 : 256x256 pixels
9 (Coarsest) : 512x512 pixels
Extra : 1024x1024 pixels

If you were to select 5 detail levels, the changes in the various levels would be limited to details with 32 pixels size or smaller. In this case the residual image would have all the details of the image, except those included in levels 1 to 5. And since the details that have been removed are relatively small, the residual image would be similar to the original image.

On the other hand, if you chose level 9 you could change the details with a size of 512 pixels and 1024 pixels (level Extra). In this case the residual image would be quite different from the original image, as the levels from 1 to Extra would contain all the details, so little more than a blurred background would be left.

Wavelet decomposition separates the lightness and the chroma channels (a* and b*) in the residual image and in each of the levels. This allows you to apply different adjustments to the brightness and tones of each level and carry out completely different processing operations on the residual image. This means that the levels and the residual image are independent and the tool will only modify those levels where changes have been made. The rest will remain untouched and the residual image will continue to be what is left after all details in all levels have been removed (whether they have been modified or not).

Note that if you want to use the Wavelet Levels tool at the same time as the CIECAM tool, you may get artifacts due to the fact that the CIECAM color model uses specific values that are close to, but different from the values of the Lab color space. Because of the way the tool is coded these artifacts are unavoidable, but their appearance will depend on which processing operations have been carried out.

The preview

The size of the image on screen has a direct impact on the perceived sharpness and on one’s ability to see the small changes introduced by the various modules: the effects of this tool are only visible at full size zoom (or larger).

In practice, this means that, for processing speed reasons, you must have the final size of the image in mind and if it is planned to reduce the image size (scale it down, not crop it), then it is advised to first export it with its final size and process it afterwards with wavelets. Keep this in mind because otherwise what you see in the preview will not be the same as the final exported result.

There is also another limitation:RawTherapee uses all the levels it can in the preview and ignores levels that have details larger than the portion of the image you see on the screen. However even if the changes in the ignored levels are not shown on screen, they will be applied when the image is saved to disk.

Examples

  • Example 1: the image is 4096x2160 pixels, you have enlarged it (to 100% or more) and in the preview you see a 1500x1200 pixel-area similar in size to the final image. This is the ideal case because on the screen you can see all the modifications you make at all levels (up to the level Extra). In addition, any changes made at any level will be included in the final image.
  • Example 2: the image is 4096x2160 pixels, but you have enlarged it and in the preview you only see 300x200 pixels, so on the screen you won't be able to see any change in details bigger than level 7 (details of 128 pixels), but when you save it the changes you made in levels 8, 9 and Extra will be included (because the image is bigger than 1024x1024 pixels).
  • Example 3: the image is 720x480 pixels and you have enlarged it until you can only see 300x200 pixels in the preview, so on the screen you will not be able to see any modification in details bigger than those of the level 7 (details of 128 pixels). When saving, the changes you made in level 8 will be included (details of 256 pixels), but levels 9 and Extra will NOT be included.

To help keep this important information in mind, the tool indicates how many levels are being used for the preview (under the last slider of the Contrast module). In the examples 2 and 3 it would indicate: «Preview maximum possible levels = 7».

Contrast by Detail Levels vs Wavelet Levels

It's worth mentioning that RawTherapee has a tool called Contrast by Detail Levels and although it looks like the Wavelet Levels tool, there are several important differences between them:

  • Contrast by Detail Levels has fewer levels (6, instead of up to 10),
  • Contrast by Detail Levels only allows you to adjust the luminance of each level, while Wavelet Levels also allows you to adjust the chroma of each level,
  • Contrast by Detail Levels adjusts equally all luminance (or chroma) values present in the level, while Wavelet Levels performs a progressive adjustment ( this is explained further in the contrast attenuation section),
  • Contrast by Detail Levels doesn't have a residual image.

That said, it is possible to use both tools at the same time. It should be noted however that Contrast by Detail Levels is applied earlier in the Processing Pipeline, so depending on the intensity of the adjustments made there, the details presented in levels from 1 to 6 may be affected. In other words, since the contrast will have changed with the Contrast by Levels of Detail settings, the analysis by Wavelet Levels could decompose the image in a different way, so the results would be different. In any case, if you have to use both tools, it is recommended that you adjust first the Contrast by Detail Levels and then adjust the Wavelet Levels.

General tool configuration

When this tool is turned on, any adjustments will affect all the subsequent modules.

Strength

With this slider you can adjust the overall intensity of the tool. It works on a similar principle to the opacity slider used for blending layers in the GIMP: any adjustments made in the Wavelet Levels tool can be blended back into the original image using the Strength slider. This allows you to make fairly aggressive adjustments and then adjust the overall intensity to achieve the desired result.

Wavelet levels

This slider lets you decide how many detail levels the image will be decomposed into. You can choose any level between 4 and 9 (the 10th level, called Extra, appears automatically when you select level 9). The higher the number, the more processing time and memory will be required.

Tiling method

A drop-down list allows you to choose from:

It is always preferable to use Full image, because it avoids problems in the transition area between tiles.

However, if you do not have enough RAM, or if you are processing very large images (e.g., 50 Megapixels or more), you may have to use the tiles:

Required memory, in bytes, with 9 detail levels
Pentax K10D Nikon D810
Megapixels (Mpx) 10.2Mpx (3888 x 2608) 36.3Mpx (7360 × 4912)
To open the image (all tools turned off) 116MiB ([Mebibytes]) 414MiB
Contrast, Chromaticity or Hue Protection turned on 329MiB 1172MiB
+ Avoid color shift 39MiB 138MiB
Total 483MiB 1724MiB

Edge performance

An image that has been decomposed into its component parts using the Daubechies method may have up to 10 coefficient scales 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 will distinguish albeit with a slight increase in processing time (often negligible)

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 allow you to refine the quality of the lower levels, or that of the residual image:

  • in some cases the best results for edge detection are obtained with D2
  • in other cases with D6 or D14

This parameter has a fairly high impact on Edge detection and also on global decomposition (the relationship between the residual image and each level).

Preview

This group of controls will help you understand how to work with the wavelets tool and assist when fine-tuning the parameters of the various modules (e.g. noise reduction).

You have a total of four drop-down lists, allowing you to tailor what you see in the preview.

The group is divided into two main drop-down lists (and several others that will be activated when you make certain selections in the main lists):

  • the first lets you choose the preview background
  • the second lets you choose which levels will be displayed in the preview

Background

In the Background: list you can choose between 3 possible backgrounds: Black, Gray or Residual Image, which will be used when viewing any of the levels.

The histogram will take into account these options and will allow you, for example, to see the effects of the settings on the residual image. Note however, that if you choose the black or gray background, you will not see the residual image (the real background) and you may find that the image has a strange look. You should be especially aware of this if you make changes to the detail levels, as the actual effect will not be seen until you put the residual image back into the background. In spite of this, it is sometimes interesting to see the changes against a neutral background to better judge what is happening (for example in noise reduction).

The process levels

This part of the tool is only accessible if you use the RawTherapee development version, which you can get from the Download page.

 

In the Process: list you can select:

  1. One level
  2. Finer details levels, with selected level: all levels from the selected down to level 1,
  3. Coarser details levels, without selected level: all levels up to the level Extra (plus the residual image), with the exception of the selected level
  4. All levels, in all directions

In previous versions of the program, the list was shown with different labels, but the behaviour of the sliders remains unchanged:

  • One level
  • Below or equal the level: now Finer details levels, with selected level
  • Above the level: now 'Coarser details levels, without selected level
  • All levels, in all directions

If you select any of the first three options, two drop-down lists will be activated just below Process:.

  • in the list on the left you can decide which level the previous options refer to (from level 1 to 9, the level Extra, or the Residual Image).
  • in the list on the right you can choose the wavelet decomposition direction (Vertical, Horizontal, Diagonal, All directions).

If you select the option All levels, in all directions, you can edit the levels directly on the residual image (the two lower lists would remain disabled). This option is useful if you already have experience with the tool and you prefer to view the entire image while editing it. It is also the option you should select before exporting. Keep in mind that what you see in the preview will be what is exported in the final image and is shown in the histogram: if you have selected One level, you will see only one level on the screen and the histogram will reflect the RGB values of that particular level. When you export the image only the chosen level will be included in the final image so before exporting, make sure you select All levels, in all directions.

Suggestions for use

  • you can select One level with a gray background to see how the selected Daubechies' coefficient (from D2 to D14) has decomposed the details, and then try out different coefficients to see which one offers the most accurate detail separation
  • you can select One level to find the level that has the details you want to work on (such as the level that has extracted the blemishes from the skin, but not its texture)
  • you can select One level and see the effect of contrast changes on that particular level, or fine tune the noise reduction
  • you can select Coarser details levels, without selected level and 8, to see the residual image along with the largest details and better appreciate the action of the various parameters of the module Residual Image
  • you can select Finer details levels, with selected level, 4 and as a background Residual Image, to see the modifications in the finest details in their context, without the larger details masking what you are doing

Example (the preview)

Below is a sample image with minimal processing that will be used in all the subsequent examples. Next to it, from left to right you will see the level 2 details, the level 4 details and the residual image.

In the two examples showing the details, the decomposition has been done with Edge performance set to D6 - standard plus, the color gray has been selected as Background:. In addition, to isolate the detail, One level has been selected in Process:.

The Residual Image, is the result of removing all of the details after choosing 5 Wavelet Levels.

  To enlarge the images click on them and when the new page loads, click on the image a second time.

  • Original image: a Prunus pisardii flower (cherry plum) at 50% of original size.
  • Level 2 details over a gray background: see how the texture of the petals has been captured in this level (you must enlarge the image to see it properly).
  • Level 4 details over a gray background: in this level you can see what we would probably draw if we wanted to make a sketch of the flower.
  • Residual Image details: we can see perfectly the fundamental hue of each zone of the photo.

Contrast module

In this module you can modify the lightness contrast (L* component of decomposition) of the details in each level independently. This allows you to increase the contrast of smaller details to give an impression of greater sharpness, while reducing the contrast of larger details. A practical benefit of this approach is that by reducing the overall contrast (the large details), you do not have to increase the fine details as much to achieve an impression of sharpness. This makes it easier to avoid introducing artifacts.

The attenuation curve

This part of the tool is only accessible if you use the RawTherapee development version, which you can get from the Download page.

 

As discussed in an earlier chapter, the wavelets tool calculates the mean and standard deviation for each decomposition level and will use these values in all of the modules.

In the case of the Contrast module, the first step is to set the contrast slider values for each decomposed level depending on the effect required. However, if you only perform this action, the contrast variations would be proportional to the original contrast (homothetical modifications, as in the Contrast by Detail Levels tool) and it would be quite easy to generate artifacts.

To overcome this problem, the contrast values for the details in each level are analyzed and ranked before being modified and progressively attenuated similar to the following curve :

Graphical representation of the proportional changes made to each contrast value.

Broadly speaking and for each level, the graph shows that:

  • the lowest contrast values are to the left and the highest contrast values to the right
  • the contrast value set for each level (contrast in the graph) defines the maximum modification that will be applied to the contrast values present in the level
  • the modification will be maximum around the average contrast value of each level (the mean value on the graph)
  • the more the contrast values vary from the average contrast value, the less they will be changed
  • high or strong contrast values are more attenuated than low ones

This means that for each level, the biggest contrast changes will be made to the mid-contrast values while avoiding the extreme values to avoid excessive effects or artifacts. However, keep in mind two fundamental points:

  1. the mean contrast value is the arithmetic mean of the contrast values present in the level: if all the contrast values are high (strong contrasts), the mean value will also be high and the extreme contrasts in that particular level will be modified less
  2. each level has its own average value, which depends on the contrast values present in the details of that particular level

Contrast Levels

The values of each level after clicking several times on Contrast +

The number of levels shown is defined by the Wavelet levels and you can reduce or increase this number in the wavelet configuration settings.

The Contrast - and Contrast + buttons make it easier to progressively change the values of each level: stronger in the first levels and more discreet in the last. As you can see in the example, the progression is homogeneous: starting from the Extra level, which does not modify its contrast, each level has been increased by 31 units with respect to the previous level (the actual amount will depend on the number of times you click on the Contrast+ or the Contrast- buttons).

In general these buttons allow you to define a logical progression of microcontrast values: higher for the first levels and lower for the last levels.

Don't forget that if a level has uniform contrast, the slider action for that level will not have any effect (if there are no details, nothing is changed).

Note that the residual image is not included in this group of controls because it is not a level: it is what is left of the original image after removing all the details that have been distributed across the levels.

Dampening and selectivity in contrast changes

This part of the tool is only accessible if you use the RawTherapee development version, which you can get from the Download page.

 

There are 3 sliders that allow you to adjust the curve as required for each level, as explained in Analysis of the contrasts in each level:

  1. Damper: by selecting positive values the upper part of the curve becomes wider around the medium contrast area, although it is weighted towards the higher contrasts. Conversely, selecting negative values narrows the curve, thus reducing the range of contrasts that undergo a noticeable modification. Graphically:
    • The curve can be widened by selecting a positiveDamper value. The green background curve is the original curve, with the slider at 0. The horizontal line (contrast) is the maximum value that can be set by the contrast slider at that level.
    • The curve can be made narrower by selecting a negative Damper value. The green background curve is the original curve, with the slider at 0. As indicated previously, the changes in the curve are more pronounced in the area with high contrast values.
  2. Offset: shifts the top of the curve, so that the most intensely modified contrasts are no longer the medium contrasts. By shifting the curve to the right, the higher contrast values will vary more, while with negative values of the slider, the lower contrast values will be modified the most. Graphically:
    Selecting a positive Offset will affect the higher-contrast values (but not the extreme contrasts) for that particular level.
  3. Low contrast threshold: this is the minimum contrast value that the details of the decomposition level must have in order for them to be taken into account. Lower contrast values, which have a value lower than the minimum value, will not be taken into account when calculating the mean of that level, nor will they undergo any variation, whatever the slider settings. In this way we can avoid highlighting noise or finer and more delicate textures.

Apply To

This part of the tool is only accessible if you use the RawTherapee development version, which you can get from the Download page.

 

This control block allows you to decide whether changes in contrast for each level apply to all the details inside each single level or only to those with pixels that are within a given range of luminance. This allows you, for example, to increase the contrast of fine details with high luminance and reduce the contrast of larger details with low luminance.

In the drop-down list, you decide where you apply the contrast changes: over the whole range of luminance values (i.e. to all the details of each level) or only to the details that have a certain luminance value in the image.

Luminance ranges

If you have selected the Whole luminance range, all the details in each level will be modified. However, if you select Selective luminance range, the levels affected by these ranges will either modify the shadow details, or modify the highlight details, but not both at once.

In addition, after selecting the Selective luminance range several curves will appear to customize the result: a pair of black and white bars with adjustable points (threshold curve) and a graphical curve. i.e.:

  • Finer levels luminance range:
    • this is a small area with a black and white gradient and four points that define the range of luminance values that will be affected by the change in contrast
      Wavelet contrast highlight.png
    • If you move your mouse over it, you will see where the default limits are: Bottom-Left: 50, Top-Left: 75, Top-Right: 98, Bottom-Right: 100. This range covers the highlights
    • these are the luminance values that must be in the image for the contrast change to be applied to the details (see following slider explanation)
    • the default values are as follows:
      • details with luminance of 50 or less will not be changed
      • details with a luminance of 50 to 75 will be subject to an increasing amount of modification
      • between 75 and 98, 100% of the modification will be applied
      • between 98 and 100, progressively less change will be applied
    • to change the values of the points on the curve, we have two options:
      • click and move one of the two points on one side (left or right) and slide the two points together
      • press the shift key, click on a point and slide it to move only that point
    • the default values are set for the highlights but you can modify the points to cover any part of the range from the shadows to the highlights as required.
  • Coarser levels luminance range:
    • another small area with a black and white gradient and four points that define the range of luminance values that will be affected by the change of contrast
      Wavelet contrast shadow.png
    • again, by hovering your mouse over it, you will see where the default boundaries are around the shadows: Bottom-Left: 0, Top-Left: 2, Top-Right: 25, Bottom-Right: 50
    • the default levels are:
      • details with luminance between 0 and 2 will be subject to an increasing amount of contrast change
      • between 2 and 25, 100% contrast modification will be applied
      • between 25 and 50, progressively less change will be applied
      • from 50 onwards no change will be applied
    • the default values are set for the shadows but you can modify the points to cover any part of the range from the shadows to the highlights as required.
  • Finer-Coarser levels:
    • is a graph allowing you to decide the extent to which the details in each of the decomposition levels (from fine to coarse), and in the previously selected luminance ranges, will be affected by the changes in contrast
    • the left part of the graph corresponds to the levels with the finest details, it should always be placed above the horizontal axis and by default it ends at level 5
    • the right side of the graph corresponds to the levels with the largest details, it should always be below the horizontal axis and by default it starts at level 6
    • the graph is divided into 10 vertical zones: from left to right from level 1, up to the level Extra. Moving the curve up or down in each zone modifies the effect of the module on these levels
    • Wavelet contrast finercoarser.png
      the changes will affect the whole range of luminance values for any levels that lie on the abscissa (horizontal dotted line). For example, if the left side of the curve ends in the area around level 3 and the right side begins around level 6, levels 4 and 5 will change all details regardless of the luminance values in the image


Case Studies

  • you are using 7 levels and only want to change level 7 within the range set in the Coarser levels luminance range threshold curve: adjust the curve on the right hand side of the Finer-Coarser levels graph to start around the area where level 7 is located and slide the curve down to set the intensity of the contrast change

Case1.png Case1.gif

  • you are using 7 levels and only want to select the finest details: adjust the starting point of the curve on the right-hand side of the graph by pressing the shift key and moving the point completely to the right. This will change the larger details over the whole range of luminance values

Case2.png Case2.gif

  • you are using 7 levels and you want to selectively adjust levels 1 and 2 in accordance with the luminance values set in the threshold curve for Finer levels luminance range and adjust levels 6 and 7 in accordance with the luminance values set in the threshold curve for the Coarser levels luminance range: set the endpoint of the curve on the left hand side to around level 2 and the starting point of the curve on the right-hand side to around level 6. This will selectively modify levels 1, 2 and 6, 7 in accordance with the relevant threshold curve settings and modify the details in levels 3, 4 and 5 across the whole range of luminance values.

Case3.png Case3.gif

Example (changing contrast)

The sample image is shown below again and next to it, from left to right we have several possibilities when we apply a contrast increase to all levels (after pressing 15 times on the button Contrast +).

First the effect on the Whole luminance range is shown and to the right the effect if you set the Selective luminance range. Finally, an example of how the changes can be nuanced by the Strength slider.

The sliders not mentioned have been left at their default values (the control points on the curves, ...).

  • Original image.
  • After applying the effect on the Whole luminance range: the increased visibility of the background noise is particularly noticeable.
  • After applying the effect over the Selective luminance range: Finer levels at 3, Coarser levels at 6: the effect is better, but it looks a little exaggerated.
  • The same treatment as above, but lowering the overall Strength of the tool to 50.

And now both the original image and the final image, side by side to better appreciate the differences: you can see an increase in the sharpness of the texture of the petals, without ruining the overall effect.

  • Original image.
  • Contrast modified and effect reduced to 50%.

Chroma Module

This module works in a similar way to the contrast module, except that in this case, the tool analyzes the color contrast (components a* and b*).

In the drop-down list Chrominance method: you have the following options:

  • Whole chroma range: with this option, any change in any level will affect the full range of chroma, regardless of the values that have been set in the Contrast module levels.
  • Saturated/pastel: here you can modify two threshold curves that act simultaneously and limit the pastel and saturated tones, regardless of the values in the Contrast module levels.
  • Link contrast levels: the changes in chroma will be directly related to those made at each level of the Contrast module.

When you select Whole chroma range or Saturated/pastel you can use the Neutral button to reset all the level sliders to their default value (0).

In addition to this, there is a Damper slider for all 3 options, which will act in the same way as described in the section on the attenuation of the Contrast module.

Whole chroma range

If you choose this option, the entire chroma range in the image is changed, regardless of how saturated each color is already.

The same observation as for contrast applies here: for there to be changes in color, there must be a pre-existing color variation in the level. If a level has a uniform color, the slider will have no effect.

The modifications at each level are limited to the range [-100,+100] : the value -100 is the equivalent of completely desaturating the level, while the value +100 increases the chroma of each detail. This method almost always introduces artifacts because the formula that is applied to the color value for each detail does not take into account whether there are any deviations from the initial value.

  • Image with the contrast modifications applied and the overall intensity of the wavelets at 100%.
  • Effect on the Whole chroma range with the sliders of the 5 levels at +100: even on downsized images you can see the color artifacts (this behaviour is expected because the effect has been applied to the maximum).
  • After applying the maximum effect on levels 1 and 2: at this size there is hardly any change (remember that we are only modifying the finest details).
  • Detail with 400% zoom (8 times larger than the preceeding images): at the top, with the color modification applied, artifacts can be seen especially on the edges of the stamens, but hardly any change in the texture of the petal.

The above examples mean that with this option you should only make subtle changes because depending on the level and the strength of the change, it is very easy to introduce highly visible artifacts. However, if the changes are too subtle, they will hardly be noticeable. In all cases the chroma noise will be affected and will increase significantly.

Saturated/pastel

With this option, the color changes in each level are focused on the saturated tones of levels with finer details and on the pastel tones of the other levels (with coarser details).

After selecting this option, a threhold slider and two threshold curves will appear, which operate in the same way as the contrast threshold curves above.

  • Saturation/pastel threshold
    • with this control you decide at what level to switch from saturated to pastel tones
    • the default value is 5, i.e. in the first 5 levels the saturated tones will be changed, and in the other levels the pastel tones (in the higher levels)
    • please note that if this value is higher than the number of levels of the wavelet decomposition, only the saturated tones will be changed
    • on the other hand, if you choose 1 (the level with only the finest details), it is as if you only modify the pastel tones
  • Pastel chroma range:
    • as was the case with the contrast, this is a small area with a black and white gradient and four points. These define the saturation level for which a change in color will be effective
      Wavelet chrom pastel.png
    • it should be noted that the dark area of the gradient corresponds to the pastel tones and the lighter area corresponds to the saturated tones (following this explanation of saturation)
    • hovering the mouse over it, you can see the limits: by default the values presented are Bottom-Left: 0, Top-Left: 2, Top-Right: 20, Bottom-Right: 30.
    • changes to the curve are made in a similar way to those made to the contrast curves
  • Saturated chroma range
    • hovering the mouse over it, you will see where the limits are: by default the values shown are Bottom-Left: 30, Top-Left: 45, Top-Right: 100, Bottom-Right: 130
      Wavelet chrom chrom.png
    • although the values of both curves do not overlap, you can see an overlap on the graphical interface. And in practice it seems that changes around the threshold level affect both the saturated and pastel tones. To be able to see clearly whether there is an effect or not (depending on whether the tone is pastel or saturated), it is necessary to use very saturated or very desaturated (pastel) values.

Nonetheless, as with the Whole chroma range option, the changes are not noticeable unless you are willing to introduce fairly visible artifacts.

  • Image with contrast modifications applied and overall wavelet strength at 100%.
  • After applying maximum effect on levels 1 and 2.
  • Applying modifications in saturated and pastel tones independently. Saturation/pastel threshold in level 3. Maximum effect on levels 1 and 2, while it stays at 60 on level 3. The rest in 0.
  • Once more the image with the contrast modifications applied and the overall strength of the wavelets at 100% (to be compared with the modified pastel and saturated tones.

As you can see, despite applying 100% changes in some levels, the differences are subtle and may appear to be negligible if you don't look closely. The most visible changes are the more intensely colored «veins» in the petals.

Link contrast levels

This option is an interesting one because the changes in chroma are directly related to those made at each contrast level.

The ratio between the changes in contrast and color is adjusted with the Chroma-contrast link strength slider: thus 0 will have no effect on chroma, while 100 will provide the maximum effect, which is more intense than for the Whole chroma range option (particularly noticeable in chroma noise).

Keep in mind that if you apply strong changes to the contrast levels, they will also appear in the chroma and will most likely generate undesirable artifacts: your best ally will always be the Chroma-contrast link strength control, to achieve clearly visible effects without producing artifacts that will ruin the photo.

Example (changing chroma)

  • Color linked to changes in contrast. Chroma-contrast link strength in 100. Image absolutely degraded by artifacts (as expected): halos and color noise in the background.
  • In this case the Chroma-contrast link strength is 50. It's not subtle, but it's controllable.
  • The same strength as the previous picture, but with the overall strength of the wavelet at 50%.
  • Reference image with contrast modifications applied and overall wavelet strength at 50%.

The modifications to the original image have been exaggerated so that the results are clearly visible. Consequently, the contrast and color modifications made to the last photo have introduced blue edges on the petals, halos around the anthers of the stamens and a noisy background. Despite this, the image is not a complete disaster given how aggressive the modifications are. At this point it is worth noting the intensity of the color in the «veins» of the petals.

Gamut Module

This module is linked to the Contrast and Chroma modules, so that adjustments can be targeted as a function of the chroma in the details. In other words, for the details in each of the wavelet levels, you can not only take into account the contrast of the luminance (contrast module) or the contrast of the tones (chroma module), you can also choose the color range that these modifications will be applied to.

Reduce artifacts in blue sky

Digital images often have speckled noise in the blue colors of the sky. Wavelet processing can accentuate this noise or generate small artifacts because it increases local contrast.

This checkbox introduces a median filter to reduce these artifacts, at the expense of loss of detail and generation of artifacts in areas where there are changes in tone or which have high contrast. Although useful for fast and undemanding processing, you will actually achieve better results with a judicious combination of the Noise Reduction tool in the Detail tab and the Denoise and Refine module in this tool.

  • Original image with speckles in the blue sky.
  • Artifacts generated by applying Reduce artifacts in blue sky: you can see extra detail at the intersections of the lines and loss of contrast in the thinnest lines.

Skin hue

Although the title refers to skin hues, the adjustment is not restricted to these and you can specify the range of tones you want to modify. The selected range will govern the changes made by the other controls in the module. However, the default range is for the usual skin tones.

For the examples that follow, the following (rather restrictive) range of red tones has been chosen:

Color range selected for the following examples. A narrow range of reds has been selected to clearly differentiate the changes.

Skin targetting/protection

This allows you to modify the contrast and/or color of details that have colors included in the above range:

  • with the slider at 0 all the colors of the image are modified equally
  • selecting -100 (sliding left) centers the contrast and color changes in the selected color range
  • on the contrary, if you select 100 (by sliding right) the colors that do not coincide with the selected range will be modified

In the intermediate positions between 0 and ±100 the changes increase progressively towards either the chosen range, or towards the rest of the colors.

  • Original image. Courtesy of Photographyblog.com
  • By applying some fairly radical changes in Contrast and Color, with the slider at 0.
  • In this case the position is -100: the contrast and color changes are centered on the range of reds.
  • When the position is at 100, changes apply to colors that are not red.

As you can see the selected colors do not have such clear boundaries (the «reds») and certain colors will be modified in one position or the other, but even so, the separation is quite clear.

Curve

Once you've set the desired Skin targetting/protection, you can use this graph to fine tune the contrast/chromaticity variation for each color: moving a control point up will increase the variation for that color, while moving it down will mitigate the changes for that particular color (although it won't eliminate the effect entirely).

However, only those colors within the range selected above will be taken into account regardless of the colors modified with the curve.

  • According to the attached curve, the intention is to highlight the green colors as much as possible, while leaving all the others in the background. The consequence is that the green ticket is the most highlighted of all the objects.
  • The curve in which changes have been mitigated for all colors except green, which has been maximized.

Avoid color shift

Processing by Wavelet Levels can introduce significant hue changes, especially near the limits of the color range of the working color space used. Activating this option makes a series of corrections to ensure that the resulting hue is related to the initial color.

Toning module

This module can be used for color toning specific detail levels as required.

However, it is not possible to act directly and accurately on the hue in each individual level because the components a* and b* have been decomposed and it is very difficult to create a precise mathematical relationship between the selected hue and the decomposed components.

Still, you can control to some extent which hues will be modified and decide which color dominants they will take.

As with the other modules, there is a Damper slider, which will act in the same way as described in the chapter on the attenuation in the Contrast module.

Excluded Colors

This part of the tool is only accessible if you use the RawTherapee development version, which you can get from the Download page.

 

The Excluded Colors graph is based on the color distribution of the chromatic coordinates used for the L*a*b* color space: the horizontal axis represents the a* component (going from green to red) and the vertical axis represents the b* component (going from blue to yellow).

However, because it is complicated to represent the actual L*a*b* space color distribution in two dimensions, the pastel shades as shown in the interface, while being mathematically accurate, are not visually intuitive, especially when selecting yellow tones. Perceptually they are equivalent to a graph such as the one below:

Approximate representation of the tone distribution in the CIEL*a*b* space.

In the center of the graph there is a white dot which, when dragged, will produce a second black dot. These two dots define the centers of the color ranges that will be protected to a greater or lesser extent by any toning adjustments that are subsequently carried out in this module. Putting the white dot on a particular color on the graph defines the center of the first color range. Similarly, the position of the black dot defines the center of the second color range. If the black dot is not moved from the initial position at the center, then the second range is ignored.

With the slider Range a and b % a zone of influence is created around the center as defined by the position of the dot on the graph and the slider % determines how large the zone will be.

With the Protection slider, the effect of any adjustments on the selected colors is reduced in the zone of influence (center plus range). The protection slider value corresponds to the % of the protection effect and will decrease as you move away from the center, until at the end of the range (at the periphery of the zone of influence) the reduction is equivalent to half the established value.

For example: Protection=80 means that the protection is 80% and therefore the center of each range will therefore only receive 20% of the toning values set in the equalizer modules (explained below). As we move away from the center and until we reach the limit set by Range a and b %, the toning will become progressively more intense until it reaches a maximum of half of the Protection value. In this case it would be 40 meaning that the colors on the periphery would undergo 60% of the set value.

Toning controls

In this group of controls, two curves are presented:

  • the Opacity Red-Green (the a*-curve) which acts on the red-green tones
  • the Opacity Blue-Yellow (the b*-curve) which acts on the blue-yellow tones

But don't forget that the final colors of the photo will be a combination of the tones of these two curves. For example: if you modify the a* curve (Red-Green Opacity) to red, all the tones of the level you are modifying will take on a red/reddish tone, but will not necessarily become red (if they also had a strong blue component, they would turn towards magenta/violet).

From a practical point of view: a tone can become more or less saturated to a certain extent and at the same time undergo a change in hue. To better visualize these effects, take a look at this view from above the L*a*b* color space, with b* as the vertical axis and a* as the horizontal axis. And don't miss this front view of the L*a*b* color space. The bottom of the top view matches the front of the front view.

In the interface you will find two curve types: Linear (Wavelet toning linear.png) and Equalizer (Wavelet toning curve.png). To choose between one or the other, you must display the list with the small triangle on the right.

The linear curve serves to cancel the effect of the axis to which it refers: if you select it in the Red-Green Opacity, you will not perform any action on those tones. Similarly with the Blue-Yellow Opacity.

In each equalizercurve there is a horizontal axis (or x axis) and a vertical axis (or y axis):

  • the x axis represents the 10 possible levels, in ascending order from left to right and evenly distributed
  • the y axis represents the intensity of the modification: when the curve rises above or falls below the mid-line the color is modified towards one end or the other of the axis of the component being modified (a* or b*)
  • in the Red-Green Opacity (the a*-curve), moving the curve upward introduces a reddish tint, while moving it downward introduces a greenish tint
  • in the Blue-Yellow Opacity (the b*-curve), moving the curve upward introduces a yellow tint, while moving it downward introduces a bluish tint

By default, the curve is flat and lies on the midline. To get an idea of how you can interact with the curve, review the explanations of the Tone Curves. And remember that if you don't like the changes you have made to the curve, you can always start over by clicking the reset arrow ResetButton.png.

As long as there are variations in contrast in the original image color, then these curves allow you to selectively vary the tone of the desired details, depending on where you place the points in the curve and the amplitude of the modification (i.e. the number of levels it affects). Everything has to be done «by eye», as there is no reference to the levels on the x axis, however you can see the effect of the modification by looking at the preview.

If you use less than 10 levels, the points affecting the rightmost levels will simply be ignored: if you are modifying the image with 4 levels, the rightmost 6 (the ones with the largest details) will be ignored.

Example (applying toning)

You will recall that we had some ugly blue halos around parts of the flower, so let's try to eliminate them (or at least hide them) with the toning controls. We take advantage of the fact that most of the image has a red dominant so we can modify the blue component, without it being too noticeable in the overall result. For this example, none of the colors have been excluded:

  • The image as it was after the changes in the Chroma module, with the overall strength at 50%.
  • By applying a maximum tonal change on the Blue-Yellow curve: see how yellow halos have been generated where they were previously blue.
  • The applied curve, which mainly affects levels 3 and 4 and to a lesser extent level 5.
  • A moderate change of tone in the Blue-Yellow curve to eliminate blue halos as much as possible.
  • The same change as in the previous image, but with the overall wavelet strength at 50%.
  • The applied curve, which affects more or less the same levels as before, but with lower intensity.

There are still some traces of blue halos in the final result although they are not as visible, and the overall appearance of the photo seems to be the same.

Denoise and Refine Module

This module complements the general Noise Reduction tool (in the Detail tab) and Edge Sharpness (explained in the next section).

Noise management is a complex issue because decisions have to be made as to where should it be done in the processing pipeline (e.g. at the beginning or at the end), what should be done and how.

In RawTherapee the general noise reduction tool is placed at the beginning of the processing pipeline to prevent subsequent tools from enhancing the noise to unacceptable levels. In the Noise Reduction tool in the Detail tab you have the following possibilities:

  • process the luminance (also based on wavelets) as a block, i.e. with no distinction between the wavelet levels
  • process the color noise using a different method: this generally requires a higher number of wavelet levels (4 to 7) and more complex processing
  • add Fourier Transform processing to refine the luminosity
  • add a median filter

Although this may be sufficient, use of the Wavelet Levels tool can provide some additional benefits (even though it uses the same algorithm as the general tool):

  • it is at the end of the processing pipeline, thus reducing the impact of noise added by other general tools (Exposure, Curves, Dynamic Range, etc.)
  • it acts separately and independently on each of the first 4 levels, whereas the standard noise reduction has an effect on the entire image. This is especially useful for low noise images and for images where the general tool has been used sparingly to preserve detail (i.e. to reduce rather than to eliminate the noise)
  • it reduces the incidence of noise in the other wavelet processing modules, e.g. allowing you to process skies without exaggerating the noise
  • it adjusts both noise processing and the degree of contrast amplification/reduction at each level, which is useful for example for astronomical images

The controls

You can adjust the noise reduction by levels as required with the following set of controls, which not only decide what noise to act on, but also link its effect to the Edge Sharpness module and the chroma denoise.

Link with Edge Sharpness' Strength

This option will modify the behavior of the lower slider of each level (explained below).

  • if you choose not to activate it, then the lower slider of each level (the Strength slider) will have a similar effect to the Contrast module when it is used over the Whole luminance range
  • if you activate it, you can change the distribution of the sharpness improvement in the first levels with the lower slider (this is explained in more detail in the next module, Edge Sharpness)

Denoise equalizer White-Black

Human vision is able to distinguish noise more easily in light areas than in dark areas, even when there is more noise in the dark areas (the shadows).

With this slider, noise reduction can be increased either in the shadows (with values to the right) or in the highlights (with values to the left).

It is easier to adjust if you choose an area with both light and dark areas, so that you can see the difference between the noise levels in the shadows and in the highlights.

Denoise and Strength

These sliders are used to control noise in the 4 finer-detail levels of the image:

  • the upper slider of each level performs the Denoise.
  • the lower one, called Strength, modifies the contrast of the details for that particular level. It should be noted that this adjustment isn't as sophisticated as the adjustments made in the Contrast module

Although the Strength slider may seem redundant, it is quite useful for recovering lost contrast in the details when higher values of Denoise have been applied. That way you don't have to jump from one module to another to quickly adjust the image. It also serves to modulate the distribution of the effect on the first 4 levels of the Edge Sharpness.

Denoise chrominance

The chroma denoise is complementary to that of the Noise Reduction tool in the Detail tab.

Because the wavelet chrominance denoise is at the end of the processing pipeline, it is useful for removing any chrominance noise that wasn't removed when using the noise reduction in the Detail tab, or noise that has been generated in other tools.

In this group of sliders you will find:

  • the Denoise Equalizer Blue-Red: chrominance noise usually comes in the form of red or blue dots and with this slider you can increase the reduction of the blue dots (to the left), or the red dots (to the right)
  • the Chrominance Fine slider: reduces the chrominance noise in the finest details, i.e. at the lowest levels
  • the Chrominance Coarse slider: reduces the chrominance noise in the coarser details, i.e. at the higher levels. This noise can be seen as patches of color that appear to be «dirty» or «do not belong» to the image and that cannot be removed with the Chrominance Fine slider because of their size

Example (applying denoise)

To get a better understanding of the extent to which the noise levels can be improved, it is useful to proceed on a level-by-level basis, taking advantage of the fact that you can view the detail in each individual level on a neutral background (as explained when dealing with the Preview). Turn off Link with Edge Sharpness' Strength and then increase the Strength slider of the level you are working on to the maximum: the noise will become obvious and you will be able to assess how much denoise is needed. Once you have adjusted the Denoise slider, move the Strength slider to the value that suits you best (negative values can also be used) and move to the next level.

  • The original image, enlarged to 300%.
  • The details of level 2, with strength: 100, without denoise. The noise is clearly visible.
  • The same level 2 with denoise applied (30). Don't forget that the Strength is still at 100.
  • The level with denoise applied and Strength reduced to 27.
  • The level 1 details.
  • The details of level 1 with Strength: 100.
  • After applying a slight noise reduction (Denoise: 12) and with the Strength still at 100.
  • The final effect of noise reduction, after having lowered the Strength to -17 (a negative value to lower the initial contrast of details).
  • The original image, enlarged to 300%.
  • The final image, enlarged to 300%.
  • A more general view of the image, without denoise. Size at 100%.
  • The same view as above, with denoise applied: you can see the reduction of noise in the stone and a slight increase in sharpness in the window.

As a general rule, it is best not to eliminate the noise completely, but simply reduce it so that it is only just visible and at the same time, increase the contrast of the details in that particular level. By amplifying the presence of the details, the noise will be ignored when the image is viewed and the photo will have a light textured look. The procedure is as follows:

  1. reduce the luminance noise slightly using the Noise Reduction tool in the detail tab, taking special care not to lose any detail
  2. select one level, gray background and level 1
  3. zoom in to 300-400% on an area with poor background detail (there must be enough detail with good contrast, but not so much that it masks the noise)
  4. move the level 1 strength slider in Denoise to the maximum (or almost), making sure that the details can still be distinguished from the noise
  5. move the top slider to a point where the noise reduction is medium-low (do not remove noise completely) and then return the lower strength slider back to its original position.
  6. the noise reduction adjustment will result in a loss of contrast in the details. To remedy this, increase the lower slider to a strength level that allows you to recover the initial contrast of the details
  7. switch to level 2 and continue with points 4, 5 and 6, but adjusting the level 2 strength
  8. continue in the same way with levels 3 and 4
  9. finish the process by selecting All levels in all directions

If the image is not very noisy, you can go straight to step 2. However, if the image is very noisy, it is important to adjust the luminance noise reduction at step 1: you need to play with the Luminance denoise slider and the Gamma slider (in the Noise Reduction tool), to direct the noise reduction to the shadows or the highlights. The more care you take with this step, the better the final result.

To increase the presence of detail you can use the lower sliders and increase the strength of each level as much as you like, but it is preferable to use the sliders in the Contrast module, as they offer more control and give better results with fewer artifacts. Also, don't forget that in this example only the Denoise and Strength sliders have been used, but the result can be further refined if necessary with the other sliders in this module.

Do not confuse the denoise in this module with the Threshold low (noise) function used for Edge detection in the Edge Sharpness module, which takes noise into account (without reducing it) to avoid highlighting it when analyzing the edges.