Noise Reduction: Difference between revisions

From RawPedia
Jump to navigation Jump to search
No edit summary
No edit summary
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{1:1}}
{{1:1}}


[[File:noisereduction2.jpg|thumb|900px|The ''Noise Reduction'' in action.]]
== Introduction ==
[[File:Noise-cactus-0-ba.png|thumb|600px|Before and after noise reduction.]]
 
Photography is based on recording light which falls on a medium during an exposure. The medium is typically film or a digital sensor. The light signal ''recorded'' on the medium is not an ideal representation of the signal which ''fell upon'' that medium - these differences constitute noise. Film and digital photographs alike are susceptible to noise (called "grain" in film), however there are various types of noise from various sources specific to each medium.
 
In order to effectively deal with mitigating noise it is useful to understand what types of noise exist and where they come from. The topic of noise is well explained in this paper by one of RawTherapee's developers and physics professor at the Enrico Fermi Institute, Emil J. Martinec:
[http://rawtherapee.com/mirror/noise/ Noise, Dynamic Range and Bit Depth in Digital SLRs]
 
Light consists of packets of energy called photons. A [https://en.wikipedia.org/wiki/Image_sensor digital sensor] comprises of millions of light-sensitive elements called ''photosites'' (also known as ''sensels'' - sensor elements). Each photosite is capable of recording a signal from a certain range of photons - too few and the photosite will not register anything; too many, and the photosite will "clip" to pure white (completely overexposed). Think of it as a bucket collecting water - despite there being moisture in the air, if it doesn't rain then the bucket is empty, but if it rains too much then it overflows.
 
Note that the idea of "pixel" does not exist at this point yet - information from several photosites will later be combined into one pixel during a process called [[demosaicing]]. Also note that some sources do write "pixels" when they mean "photosites".
 
The physical sensitivity of the sensor is constant, however the photographer can amplify the recorded signal by modifying a setting you know as ISO (see the [https://en.wikipedia.org/wiki/Film_speed Film Speed] article on Wikipedia). Since the signals recorded by the sensor are not perfect, using a higher ISO amplifies not only the desired signal, but also the noise. Sensors are susceptible to noise at every ISO level, however the higher the ISO the more apparent the noise.
 
There are different tools for dealing with different types of noise:
* The Noise Reduction tool is best at dealing with photon shot noise ([https://en.wikipedia.org/wiki/Gaussian_noise Gaussian] and [https://en.wikipedia.org/wiki/Shot_noise Poisson] noise) and film grain, and some sensor read noise.
* Sensor read noise and thermal noise are best handled by the [[Dark-Frame]] tool.
* Salt and pepper noise (sudden white or black pixels) is best handled by the [[Impulse Noise Reduction]] tool.
* Hot and dead pixels are best dealt with using the [[Preprocessing#Hot.2FDead_Pixel_Filter|Hot/Dead Pixel Filter]].
* Pattern noise (periodic, anisotropic) is best handled by the [[Preprocessing#Line_Noise_Filter|Line Noise Filter]]. You can also fix pattern noise (de-screen) after RawTherapee in GIMP, using the Fourier transform in G'MIC.
 
Regardless the source, noise will manifest itself as blotches of deviating color - "chrominance noise", and deviating brightness - "luminance noise".
# Chrominance noise is endemic to digital images, it is generally unattractive and something you will always want to remove.
# Luminance noise, on the other hand, looks like film grain and can be attractive, so it's not uncommon to want to remove chrominance noise but keep luminance noise.
 
<div align="center">
<gallery caption="Examining Noise" mode=nolines widths=600px heights=450px>
File:noise-wall.png|A noisy test photo taken at ISO 6400.
File:Noise-wall-demosaic-amaze.png|AMaZE demosaicing leads to small maze-like patterns.
File:Noise-wall-demosaic-lmmse.png|LMMSE demosaicing avoids maze-like patterns while preserving detail.
File:Noise-wall-luminance100-chrominance-off.png|This is what chrominance noise looks like. Luminance detail was obliterated to make the chrominance noise more clear. Notice the color blotches in what should be a smooth wall.
File:Noise-wall-luminance100-chrominance-on.png|Enabling chrominance noise reduction eliminates the colored blotches.
File:Noise-wall-chrominance.png|This is what luminance noise looks like. Chrominance noise was removed to make the luminance noise more clear.
File:Noise-wall-luminance-tweaked-chrominance-on-median-off.png|Both chrominance and luminance noise were removed.
File:Noise-wall-luminance-tweaked-chrominance-on-zoom-median-off.png|Tiny pixel-sized artifacts are left-over from noise reduction.
File:Noise-wall-luminance-tweaked-chrominance-on-zoom-median-on.png|These artifacts can be removed using the median filter.
</gallery>
</div>


Not everyone's requirement for good noise reduction is the same. Some like a completely clean, smooth result, while others prefer to have some grain left over to give the photo a more film-like quality. RawTherapee's powerful ''Noise Reduction'' tool caters to all your needs - it lets you eliminate noise while retaining detail. It uses [http://en.wikipedia.org/wiki/Wavelet wavelets], a [https://en.wikipedia.org/wiki/Fourier_transform Fourier transform] and a [https://en.wikipedia.org/wiki/Median_filter median filter] to work its magic. Read on to learn how to use it efficiently.
Not everyone's requirement for good noise reduction is the same. Some like a completely clean, smooth result, while others prefer to have some grain left over to give the photo a more film-like quality. RawTherapee's powerful ''Noise Reduction'' tool caters to all your needs - it lets you eliminate noise while retaining detail. It uses [http://en.wikipedia.org/wiki/Wavelet wavelets], a [https://en.wikipedia.org/wiki/Fourier_transform Fourier transform] and a [https://en.wikipedia.org/wiki/Median_filter median filter] to work its magic. Read on to learn how to use it efficiently.


== Usage ==
== Usage ==
When working with very noisy, high ISO images, it is recommended to use the LMMSE or IGV demosaicing methods. They will prevent false maze patterns from appearing, and prevent the image from looking washed-out due to heavy noise reduction.
This section details the order of operations for removing noise.
 
# Start by ensuring you're using the optimal demosaicing algorithm. AMaZE is recommended for general RawTherapee use, however, when working with very noisy, high-ISO images, it is recommended to use the LMMSE or IGV demosaicing methods instead. AMaZE can lead to tiny maze-like artifacts appearing in very noisy images, whereas LMMSE and IGV are designed to prevent that from happening.
# Check the sharpening tools to make sure that you're not sharpening any fine detail, because your noisy photo has no fine detail! If you're using [[Contrast by Detail Levels]] or [[Wavelets]], make sure that the first one or two fine-detail contrast sliders are at 0 to prevent these tools from amplifying noise.
# Zoom into the photo to 100% or more and find an area that has both sharp, in-focus parts as well as large, plain or out-of-focus ones, so that you have a good overview of the effects of the tool.
# Enable the [[Preprocessing#Hot.2FDead_Pixel_Filter|Hot/Dead Pixel Filter]] if you notice salt-and-pepper noise (black and/or white pixels).
# Enable the Noise Reduction tool. Chrominance noise is automatically removed and usually does not require any tweaking. At this point the remaining noise looks more like film grain. If you are happy with keeping it then you are done, else keep reading.
# To remove luminance noise, set the ''Detail recovery'' slider to 0, and increase the ''Luminance'' slider until the noise has been smoothed-away.
# Increase the ''Detail recovery'' slider until you regain a satisfactory level of detail.
# You may notice some small artifacts remain from the noise reduction process. Use the Median filter to remove them.
# While it is generally not recommended to combine sharpening with noise reduction, RawTherapee-5.5 has a "contrast threshold" adjuster in the [[Sharpening]] tool, thanks to which you can sharpen details while preserving the smoothness of uniform, flat areas.


To find the best set of Noise Reduction values for your image:
<div align="center">
# Check the sharpening tools to make sure that you're not sharpening any fine detail, because your noisy photo has no fine detail! All they would do is amplify the noise. If you're using ''Contrast by Detail Levels'' to give the image more depth, make sure that the first "''0 (Finest)''" slider, and probably the second one "''1''" too, are turned off.
<gallery caption="Noise Reduction Step by Step" mode=nolines widths=600px heights=450px>
# Zoom into the photo to 100% and find an area that has both sharp in-focus parts as well as large plain out-of-focus ones, so that you can prevent noise reduction from destroying details as you tweak it.  
File:Noise-cactus-1-amaze.png|The noisy image.
# Start by setting the ''Luminance Detail'' slider to 0,
File:Noise-cactus-2-lmmse.png|Changing the demosaicing method to LMMSE eliminates the small maze-like patterns and makes the salt-and-pepper noise more clear.
# Decide whether you just want to work with the ''Luminance'' slider, or whether you want to use the Luminance Curve for finer control. Increase the slider or curve just until the luminance noise has been smoothed away.
File:Noise-cactus-3-pixelfilter.png|Enabling the [[Preprocessing#Hot.2FDead_Pixel_Filter|Hot/Dead Pixel Filter]] eliminates the salt-and-pepper noise.
# Because luminance noise is all gone now (though we haven't recovered any detail yet), we can see color noise very clearly. This is a good time to denoise the color channels.
File:Noise-cactus-4-nr-chroma.png|Enabling automatic chromaticity noise reduction renders a pleasantly-grainy image.
## Either by setting manually the sliders : Increase "''Chrominance (Master)''" to a level where chrominance noise is gone but color detail in small objects hasn't been lost. You can reduce or boost the effects of noise reduction on the red/green and blue/yellow channels by respectively lowering or raising the "''Chrominance - Red-Green/Blue-Yellow''" sliders.  
File:Noise-cactus-5-nr-luminance.png|Luminance noise was smoothed-away using the ''Luminance'' slider.
## Or by using the "automatic" mode
File:Noise-cactus-6-nr-detailrecovery.png|Detail was restored using the ''Detail recovery'' slider.
# Now increase the ''Luminance Detail'' slider to recover detail until you are happy with the noise:detail trade-off.
File:Noise-cactus-7-nr-median.png|The median filter was used to eliminate left-over artifacts.
File:Noise-cactus-8-sharpen.png|Sharpness was restored using an unsharp-mask with a contrast threshold to prevent sharpening areas which should be smooth.
</gallery>
</div>


== Interface ==
== Interface ==
=== Method ===
Noise reduction can be carried out in the RGB or Lab color spaces. Working in the Lab space gives you the advantage of keeping the color independent of the luminance. The difference between Lab vs RGB mode is often negligible if you just use luminance noise reduction (via the "''Luminance''" and "''Luminance Detail''" sliders), and most evident when carrying out strong chrominance noise reduction (via the "''Chrominance - Master''" slider).


Closely examine large areas of strong saturation with fine detail - such as the pattern on a colored shirt or the petal of a flower - as you switch between the RGB and Lab modes.
=== General ===
Closely examine large areas of strong saturation with fine detail - such as the pattern on a colored shirt or the petal of a flower - as you switch between the RGB and L*a*b* spaces.
 
The following images demonstrate the effects of various types of noise reduction, exaggerated for clarity. While the source image does not contain any very-low-frequency ''noise'', it was chosen because it does display the effects (and side-effects) very well.


<gallery caption="Comparison of Noise Reduction Methods" perrow="4"| style="text-align: center">
<div align="center">
Image:Rt noisereduction 1 off-vs-rgb.jpg|Disabled vs enabled (RGB mode).
<gallery caption="Comparison of Noise Reduction - Color Spaces" mode=nolines widths=600px heights=450px>
Image:Rt noisereduction 2 rgb-vs-lab.jpg|RGB vs Lab.
File:Noise-handkerchief-1-off.png|The noisy image. Detail recovery will be intentionally left at 0, and chromaticity strength will be intentionally set very high, to emphasize effect.
Image:Rt noisereduction 3 lmmse off-vs-rgb.jpg|Disabled vs enabled (RGB mode).
File:Noise-handkerchief-2-luminance-lab-conservative.png|Luminance noise reduction in L*a*b* space, conservative.
Image:Rt noisereduction 4 lmmse rgb-vs-lab.jpg|RGB vs Lab.
File:Noise-handkerchief-3-luminance-lab-aggressive.png|Luminance noise reduction in L*a*b* space, aggressive.
File:Noise-handkerchief-4-luminance-rgb-conservative.png|Luminance noise reduction in RGB space, conservative.
File:Noise-handkerchief-5-luminance-rgb-aggressive.png|Luminance noise reduction in RGB space, aggressive.
File:Noise-handkerchief-6-chrominance-lab-conservative.png|Chrominance noise reduction in L*a*b* space, conservative.
File:Noise-handkerchief-7-chrominance-lab-aggressive.png|Chrominance noise reduction in L*a*b* space, aggressive. Notice how colors bleed one into another in areas where one hue meets the other - navy blue bleeds into cyan, green bleeds into dull-red, dull-red bleeds into crimson-red, etc.
File:Noise-handkerchief-8-chrominance-rgb-conservative.png|Chrominance noise reduction in RGB space, conservative.
File:Noise-handkerchief-9-chrominance-rgb-aggressive.png|Chrominance noise reduction in RGB space, aggressive. Low-frequency detail is lost.
</gallery>
</gallery>
</div>
==== Color Space ====
Noise reduction can be performed in the L*a*b* and RGB color spaces.
When working in the L*a*b* space, the L* channel is used for luminance and the a* and b* channels are used for chromaticity.
When working in the RGB space, the Y from the CIE XYZ color space is used for luminance and (X-Y) and (Y-Z) are used for chromaticity.
==== Mode ====
There are two general noise reduction "Modes" which control whether only high frequency or also low frequency noise is removed. ''Low frequency'' noise is noise whose blotches cover a large area; conversely, ''high frequency'' noise has smaller blotches which cover fewer pixels.
# Conservative - removes all except very low-frequency noise, so color detail is better preserved at the expense of not removing very large blotches. Use in most cases.
# Aggressive - removes also very low-frequency noise at the expense of being more aggressive with higher frequency noise. Use only on extremely noisy photos.


=== Quality ===
==== Gamma ====
"High" makes two noise reducing passes, each one with a different algorithm, for higher quality at the cost of processing time.
Gamma varies noise reduction strength across the range of tones. Smaller gamma values let noise reduction affect all tones emphasizing the action on shadows, while higher gamma values limit the effect to brighter tones only.
You can select in "Preferences > Performance & Quality" the number of levels for the wavelet:
* No: no extra level
* One level or two levels: add this number to the referenced one. This increases the processing time, but also improves the chromatic noise processing, mostly the ugly noise "packets"


=== Luminance panel ===
=== Luminance ===
==== Luminance control ====
[[File:Rt nr luminancecurve books.jpg|thumb|600px|The Luminance Curve in RawTherapee-4.1 was used to completely remove noise in dark areas while fully retaining structure of lighter areas.]]
Here you can choose between 2 options for luminance control, either by using the slider or by using a curve. both systems don't interact.


===== Luminance =====
"Luminance control" lets you choose whether you want to manipulate the luminance noise reduction via sliders or a curve.
This slider lets you control coarse smoothing of luminance.


===== Luminance Curve =====
Adjusting the "Luminance" slider is equivalent to manipulating the amplitude of the luminance curve - both affect how strong the noise reduction effect is. The curve has the additional advantage of letting you control noise reduction strength as a function of the pixels' luminance - e.g. it allows you to have strong luminance noise reduction in the shadows and none in the highlights.
[[File:Rt nr luminancecurve books.jpg|thumb|900px|The Luminance Curve was used to completely remove noise in dark areas while fully retaining structure of lighter areas.]]
This curve lets you target areas of a specific luminance more precisely, so you can have strong noise removal in the shadows while not touching light parts at all. This is desirable as noise will generally be stronger in the shadows than in the highlights. You can use the curve alone or the the slider alone, but not both simultaneously.  


==== Luminance - Detail ====
The "Detail recovery" slider allows you to recover structure while not reintroducing noise, unless you set this value too high.
This slider is for detail recovery after application of the Luminance noise reduction. It will recover the structure while not reintroducing the noise, unless you set this value too high.


=== Chrominance panel ===
=== Chrominance ===


==== Auto method ====
; Modes
This method offers three or four choices according to the chosen configuration in "Preferences > Performance & Quality":
Chrominance noise reduction can be performed using one of three or four modes, according to the chosen configuration in "Preferences > Performance & Quality > Noise Reduction":


===== Tool mode - "Standard"=====
Tool mode - Standard:
** Manuel
* Manual
** Automatic global
* Automatic global
** Preview
* Preview


===== Tool mode - "Expert"=====
Tool mode - Expert:
** Manuel
* Manual
** Automatic global
* Automatic global
** Auto multi-zones
* Auto multi-zones
** Preview multi-zones
* Preview multi-zones


===== Preview noise =====
; Preview noise
*An indicator "Preview noise" gives the estimated chromatic noise values, after "Chrominance" processing
The "Preview noise" indicator gives the estimated chromatic noise values after "Chrominance" processing:
** Mean: estimate the average value of the noise, all channels taken together
* Mean: estimates the average noise value across all channels.
** High: estimate the highest value of the noise, all channels taken together
* High: estimate the highest noise value across all channels.


===== Manuel =====
==== Mode: Manual ====
*The three sliders and the curve - Chrominance curve -  act on the full image. You control the image settings manually.


====== Chrominance - Master ======
The three sliders and the curve act on the full image. You control the settings manually.
Applies noise reduction to colour channels. If this slider is at 0,5, the Delta sliders have no effect and the wavelet is not enabled.  


====== Chrominance - Red-Green ======
; Master
Can be used to reduce or boost the effect of colour noise reduction in the red-green channel ("a" in Lab)  
Controls the strength of chrominance noise reduction. Functions as an offset independently to the red-green and blue-yellow values. For example if master=50, red-green=-50 and blue-yellow=-50, the end result is 0; no effect.
; Red-Green
Reduce/boost noise reduction in the red-green channel (a* in L*a*b*).


====== Chrominance - Blue-Yellow ======
; Blue-Yellow
Can be used to reduce or boost the effect of colour noise reduction in the Blue-yellow channel ("b" in Lab)
Reduce/boost noise reduction in the blue-yellow channel (b* in L*a*b*).


===== Automatic global =====
* The processing algorithm, which acts on the full image, depends on several cells spread out in the image (9 so far). For each cell, is calculated:
**An everage noise level for the Red-Green channel and the Blue-Yellow channel;
**a maximum noise level for the same channels


*If you can't choose the place of the cells, you can choose their size (Preferences > Performance & Quality > Cell size):
; Chrominance curve
**Mini: 100x115 - Small: 250x287 - Medium: half the tiles size (by default) - Maxi: tiles size
The chrominance curve lets you control chrominance noise as a function of the pixels' chrominance - e.g. it allows you to have strong chrominance noise reduction in areas of low saturation and weak noise reduction in areas of high saturation. This curve modulates the "Master", "Red-Green" and "Blue-Yellow" sliders' action by multiplying their values by the curve ordinate. For example, if the master slider is set to 30 and the curve is at mid-height, the equivalent result will be about 45. It can be useful for example in "Automatic global" mode to boost the grey or drab areas that will have a setting often too weak due to the settings average value. These grey areas are those where the visible noise become unpleasant, on the contrary to the very saturated areas where the same noise level (less visible) is acceptable.
**The tiles are used in the noise processing to boost and reduce the RAM consumption, they have a size of about 700 pixels.
**There is advantages and drawbacks in each mode:
***The smaller the cells are, the faster the processing is, we can keep this case for homogeneous images
***The larger the cells are, the closer we are of the real conditions.


*You can also in "Preferences > Performance & Quality > Denoising level", choose a noise processing level: Low (by default) or standard.
==== Automatic global ====
The algorithm splits the image into multiple cells. For each cell the following are calculated:
* An average noise level for the red-green channel and the blue-yellow channel.
* A maximum noise level for the same channels.


*Then, a weighting is made, taken into account the noise levels determined above, to adjust the three sliders (Master, Red-Green, Blue-Yellow) and update "Noise preview"
==== Preview ====
This mode is only operational when zoomed to 100% or more. It analyzes the areas currently visible in the preview (if you are zoomed to 100% or more) and calculates:
* An average noise level for the red-green channel and the blue-yellow channel.
* A maximum noise level for the same channels.


*The image that appears in the "Preview panel", shows what it will look like in TIF or JPG output
The three sliders - Master, Red-Green and Blue-Yellow - as well as the "Preview noise" values, are updated accordingly.


*The settings (sliders position) are the same whatever is the "Preview panel" position in the full image.
If you would like to keep the currently calculated values then you should switch back to "manual" mode, else the values will be re-calculated when you pan or when you copy the profile to other images.


*The settings are not stored in the pp3 files. If you want to re-use them for operations on profiles, you have to switch in "manual" mode
==== Auto multi-zones ====
Only available in "Expert" mode.


===== Preview =====
This mode is available chiefly to denoise images which cannot fit in RAM as a whole.
* This mode is obviously only operational with a zoom at 100% and over, it acts on the full image
* For each preview motion (moving in the image, zoom) the automatic denoising calculation is done
* It takes into account the operational window and calculates for this one, the medium noises of the Red-Green channel and the Blue-Yellow channel and the maxima for these two channels as well.
* This window is used as "selecting area"
* The three sliders "Master", Red-Green and Blue-Yellow as well as "Noise preview" are updated.
* The setting got by choosing an area is used for the full image.


* If you select a TIF or JPG output from this selection and in zoom mode, the output image will match to the preview.
This mode is only operational when saving the output image - its affects are not visible in the preview regardless of zoom level!
* About the "automatic" mode it is advised, after having chosen the preview area and checked the processing quality, to switch back in "manual" mode, if you want to keep this setting for other images.
* The option Preference > Performance & Quality >  Denoising level" is operational.


===== Auto multi-zones =====
The image is split into tiles. Each tile has a vertical and horizontal step of about 500 to 800 pixels. Depending on the image size and the chosen option in "Preferences > Performance & Quality > Number of tiles", the number of tiles can vary from 12 to over 120. Each of the three values are calculated separately for each tile, leading up to over 120 x 3 unique values. The tiles are blended at the seams to avoid artifacts if adjacent tiles' value differ strongly. This can be prevented via Preferences > Performance & Quality > Auto multi-zone smoothing":
*This mode is only operational for a TIF/JPG output and is output enabled if and only if "Auto multi-zones" is selected.
* None: each tile's values are completely independent of each other and of other tiles'.
*The processing is not plain in the full image, but each tile specific.
* Low: a part of the other tiles processing is taken into account, but in a weak way.
*The is no fully usable "Preview", but as you can read it in the "Preview multi-zones" section, a convenient help may allow the user to have a very good approximation of the final image by moving the preview in the full image.
* High: a part of the other tiles processing is taken into account more strongly.
* Max: an average of all the tiles is used. This mode works like "Automatic global", but instead of using just 9 cells it uses all of the tiles (12 to over 120).


* The "Auto multi-zones" mode use the tiles that are used in the RawTherapee noise processing, to boost the processing and decrease the memory consumption.
==== Preview multi-zones ====
Only available in "Expert" mode.


*The image is divided in tiles by the software, with a vertical and horizontal step of about 500 to 800 pixels.
Identical to "Preview", but you have the possibility to evaluate with a very good approximation the result of "Auto multi-zones" with the help of the information given as a supplement to "Preview noise".
*This give a number of tiles that, depending on the image size and the chosen option in "Preferences > Performance & Quality > Number of tiles", can vary from 12 to over 120.
*There is a tiles overlapping with a transition between a tile setting and the adjoining tiles ones. You have then not to worry about a possible difference between adjoining tiles.
*Each tile is processed independently, according to the cell size ("Preferences > Performance & Quality"), and ends to a setting of the red-green and blue-yellow channels totally independant for each tile. if we could set a manual setting of the tiles (up to 120) we would have 120 different settings of "Master", 120 different settings of "red-green", 120 different settings of "blue-yellow"!
*This lead to a multiple processing of only one image with as many settings as there is tiles.
*It is however possible to modulate the result with the help of the "Preferences > Performance & Quality > Auto multi-zone smoothing" option. It offers four choices:
** None: the processing described above is carried out
** Low: a part of the other tiles processing is taken into account, but in a very low way
** High: as above but more pronounced
** Max - average of all the tiles: this mode works like "Automatic global", but instead of using 9 cells, it is the tiles number that replaces the cells number (accordingly these ones can vary from 12 up to over 120).
* All the options of "Preferences > Performance & Quality" are usable.


===== Preview multi-zones =====
Under the label "Preview noise: Mean=x High=y", two lines are displayed:  
* Identical to Preview
* The first one gives the tile size in pixels, and its center position on the full image.
* But you have the possibility to evaluate with a very good approximation the result of "Auto multi-zones" with the help of the information given as a supplement to "Preview noise"
* The second one gives the preview size in pixels, and its center position on the full image.
* Under the indications "Preview noise: Mean=xx High=yy", two lines are displayed:  
** The first one give the tile size in pixels, and its centre position on the full image.
** The second one give the preview size in pixels, and its centre position on the full image. The preview size depends on several parameters: zoom, lateral windows size.
** Try to adjust whatever is best the centres and the sizes by moving the preview with the mouse and by modifying the zoom. Be careful, we are in noise processing, and it is very rare there is strong discontinuities, so gaps of some pixels or dozens of pixels are acceptable.


==== Chrominance curve ====
The preview size depends on several parameters: zoom, lateral windows size.  
This curve allows to aim more precisely specific chromaticity areas.
* As a reminder, chromaticity in L*a*b* mode conveys the colour intensity. A low chromaticity will convey grey or drab tones, a high chromaticity will convey saturated colours.
* This curve modulates the "Master", "Red-Green" and "Blue-Yellow" sliders action by multiplying their values by the curve ordinate.
* For example, if the master slider is set to 30 and that the curve is at mid-hight, the equivalent result will be about 45.
* It is usable in all the modes: manual, automatic global, auto multi-zones and preview.
* It can be useful for example, (default setting) in "Automatic global" mode to boost the grey or drab areas that will have a setting often too weak due to the settings average value. These grey areas are those where the visible noise become unpleasant, on the contrary to the very saturated areas where the same noise level (less visible) is acceptable.
* Note that in some cases, you can also use as a complement to the sliders acting, the median filter "Chroma only" in order to avoid too hight wavelets values (impression of washed out colours details).


=== Gamma ===
You can adjusting the centers of the tiles and their size by panning the preview with the mouse and by modifying the zoom.
Gamma varies noise reduction strength across the range of tones. Smaller gamma values let noise reduction affect all tones emphasizing the action on shadows, while higher gamma values limit the effect to brighter tones only.


=== Median ===
=== Median ===
[[File:Rt nr median books.jpg|900px|thumb|The Median filter was used to eliminate artifacts which fit in a 3x3 window left over from the noise reduction process.]]
[[File:Rt nr median books.jpg|600px|thumb|The Median filter in RawTherapee-4.1 was used to eliminate artifacts which fit in a 3x3 window left over from the noise reduction process.]]
Use this filter to remove tiny, sharp-looking artifacts left-over from noise reduction. The [https://en.wikipedia.org/wiki/Median_filter median filter] replaces each pixel with the median value of its neighboring pixels. The contiguous group of pixels being sampled is called the "windows". This window slides pixel by pixel over the entire image. You can choose the size of this window using the "Median type" drop-down. The larger the size, the longer it takes.
[[File:Rt nr median zoom books.jpg|thumb|600px|Comparison of noise reduction without and with median filtering, zoomed to 200%. While the filtered image on the right may appear less sharp, notice that the unfiltered image on the left does not really contain any more detail - the noise gives the illusion of sharpness. At the same time, the filtered image when saved to JPEG/92/standard was almost 40% smaller than the unfiltered one (350kB vs 215kB). RawTherapee-4.1.]]
 
Use this filter to remove tiny, sharp-looking artifacts left-over from noise reduction.
 
; Median Type
The [https://en.wikipedia.org/wiki/Median_filter median filter] replaces each pixel with the median value of its neighboring pixels. The contiguous group of pixels being sampled is called the "windows". This window slides pixel by pixel over the entire image. You can choose the size of this window using the "Median type" drop-down. The larger the size, the longer it takes.


Available window sizes:
Available window sizes:
Line 203: Line 242:
Sometimes it is possible to achieve higher quality running several iterations with a small window size than one iteration with a large window size.
Sometimes it is possible to achieve higher quality running several iterations with a small window size than one iteration with a large window size.


When using the "Luminance only" and "Lab" methods, median filtering will be performed just after the wavelet step in the noise reduction pipeline. When using the "RGB" mode, it will be performed at the very end of the noise reduction pipeline.
;Median Method
You have five methods at your disposal:
* Luminance only: works in L*a*b* mode, but only affects the L* channel.
* Chroma only: works in L*a*b* mode, but only affects the a* and b* channels.
* Weighted L* (little) + a*b* (normal): affects all channels in L*a*b* mode, but acts more weakly on the L* channel.
* L*a*b*: affects all channels equally.
* RGB: works in RGB mode. In this mode the window size choice is limited to 3x3 soft, 3x3 and 5x5.


[[File:Rt nr median zoom books.jpg|thumb|900px|Comparison of noise reduction without and with median filtering, zoomed to 200%. While the filtered image on the right may appear less sharp, notice that the unfiltered image on the left does not really contain any more detail - the noise gives the illusion of sharpness. At the same time, the filtered image when saved to JPEG/92/standard was almost 40% smaller than the unfiltered one (350kB vs 215kB).]]
When using the "Luminance only" and "L*a*b*" methods, median filtering will be performed just after the wavelet step in the noise reduction pipeline. When using the "RGB" mode, it will be performed at the very end of the noise reduction pipeline.
You may wonder what use median filtering has other than the elimination of pixels that strongly differ from their surrounding neighbors. One of these benefits is a reduction in file size when saving to compressed formats such as JPEG and PNG. Median filtering removes variations which you will lose anyway if you downscale the image. You are also likely not to see these variations if you print the image. Removing them using median filtering can reduce the file size by even 40% (tested using JPEG compression strength 92 with "balanced quality" [https://en.wikipedia.org/wiki/Chroma_subsampling chroma subsampling]), so give it a try if file size is an issue.


You can also use the median filter "Chroma only" as a complement to the wavelets processing. Doing so allows to reduce required values for the wavelets processing and to avoid fading details too much.
You may wonder what other uses median filtering has apart from the elimination of pixels which strongly differ from their surrounding neighbors for aesthetic reasons. One of these benefits is a reduction in file size when saving to compressed formats such as JPEG and PNG. Median filtering removes variations which you will lose anyway if you downscale the image. You are also likely not to see these variations if you print the image. Removing them using median filtering can reduce the file size by even 40% (tested using JPEG compression strength 92 with "balanced quality" [https://en.wikipedia.org/wiki/Chroma_subsampling chroma subsampling]), so give it a try if output file size is a factor.


==== Method ====
Finally, the "chroma only" median filter method can be used as a complement to automatic chrominance noise reduction calculation - by reducing sharp outliers it can soften the calculated values, thereby avoiding fading out color detail too much.
You have five methods at your disposal:
* Luminance only: works in L*a*b* mode, but only affects the L* channel
* Chroma only: works in L*a*b* mode, but only affects the a* and b* channels
* Weighted L* (Little) + a*b* (normal): works in L*a*b* mode, but acts more weakly on the L* channel
* L*a*b*: works in L*a*b* mode, with equality of the action on the three channels L*, a*, b*
* RGB: works in RGB mode. In this mode the window size choice is limited to 3x3 soft, 3x3 and 5x5.

Revision as of 13:10, 14 June 2018

The effects of this tool are only visible at a preview scale of 1:1 or more. Use a detail window (click on the Window-add.png icon under the main preview panel) to inspect a part of the image, or zoom the main preview to 100% (also called 1:1) Magnifier-1to1.png.


Introduction

Before and after noise reduction.

Photography is based on recording light which falls on a medium during an exposure. The medium is typically film or a digital sensor. The light signal recorded on the medium is not an ideal representation of the signal which fell upon that medium - these differences constitute noise. Film and digital photographs alike are susceptible to noise (called "grain" in film), however there are various types of noise from various sources specific to each medium.

In order to effectively deal with mitigating noise it is useful to understand what types of noise exist and where they come from. The topic of noise is well explained in this paper by one of RawTherapee's developers and physics professor at the Enrico Fermi Institute, Emil J. Martinec: Noise, Dynamic Range and Bit Depth in Digital SLRs

Light consists of packets of energy called photons. A digital sensor comprises of millions of light-sensitive elements called photosites (also known as sensels - sensor elements). Each photosite is capable of recording a signal from a certain range of photons - too few and the photosite will not register anything; too many, and the photosite will "clip" to pure white (completely overexposed). Think of it as a bucket collecting water - despite there being moisture in the air, if it doesn't rain then the bucket is empty, but if it rains too much then it overflows.

Note that the idea of "pixel" does not exist at this point yet - information from several photosites will later be combined into one pixel during a process called demosaicing. Also note that some sources do write "pixels" when they mean "photosites".

The physical sensitivity of the sensor is constant, however the photographer can amplify the recorded signal by modifying a setting you know as ISO (see the Film Speed article on Wikipedia). Since the signals recorded by the sensor are not perfect, using a higher ISO amplifies not only the desired signal, but also the noise. Sensors are susceptible to noise at every ISO level, however the higher the ISO the more apparent the noise.

There are different tools for dealing with different types of noise:

  • The Noise Reduction tool is best at dealing with photon shot noise (Gaussian and Poisson noise) and film grain, and some sensor read noise.
  • Sensor read noise and thermal noise are best handled by the Dark-Frame tool.
  • Salt and pepper noise (sudden white or black pixels) is best handled by the Impulse Noise Reduction tool.
  • Hot and dead pixels are best dealt with using the Hot/Dead Pixel Filter.
  • Pattern noise (periodic, anisotropic) is best handled by the Line Noise Filter. You can also fix pattern noise (de-screen) after RawTherapee in GIMP, using the Fourier transform in G'MIC.

Regardless the source, noise will manifest itself as blotches of deviating color - "chrominance noise", and deviating brightness - "luminance noise".

  1. Chrominance noise is endemic to digital images, it is generally unattractive and something you will always want to remove.
  2. Luminance noise, on the other hand, looks like film grain and can be attractive, so it's not uncommon to want to remove chrominance noise but keep luminance noise.

Not everyone's requirement for good noise reduction is the same. Some like a completely clean, smooth result, while others prefer to have some grain left over to give the photo a more film-like quality. RawTherapee's powerful Noise Reduction tool caters to all your needs - it lets you eliminate noise while retaining detail. It uses wavelets, a Fourier transform and a median filter to work its magic. Read on to learn how to use it efficiently.

Usage

This section details the order of operations for removing noise.

  1. Start by ensuring you're using the optimal demosaicing algorithm. AMaZE is recommended for general RawTherapee use, however, when working with very noisy, high-ISO images, it is recommended to use the LMMSE or IGV demosaicing methods instead. AMaZE can lead to tiny maze-like artifacts appearing in very noisy images, whereas LMMSE and IGV are designed to prevent that from happening.
  2. Check the sharpening tools to make sure that you're not sharpening any fine detail, because your noisy photo has no fine detail! If you're using Contrast by Detail Levels or Wavelets, make sure that the first one or two fine-detail contrast sliders are at 0 to prevent these tools from amplifying noise.
  3. Zoom into the photo to 100% or more and find an area that has both sharp, in-focus parts as well as large, plain or out-of-focus ones, so that you have a good overview of the effects of the tool.
  4. Enable the Hot/Dead Pixel Filter if you notice salt-and-pepper noise (black and/or white pixels).
  5. Enable the Noise Reduction tool. Chrominance noise is automatically removed and usually does not require any tweaking. At this point the remaining noise looks more like film grain. If you are happy with keeping it then you are done, else keep reading.
  6. To remove luminance noise, set the Detail recovery slider to 0, and increase the Luminance slider until the noise has been smoothed-away.
  7. Increase the Detail recovery slider until you regain a satisfactory level of detail.
  8. You may notice some small artifacts remain from the noise reduction process. Use the Median filter to remove them.
  9. While it is generally not recommended to combine sharpening with noise reduction, RawTherapee-5.5 has a "contrast threshold" adjuster in the Sharpening tool, thanks to which you can sharpen details while preserving the smoothness of uniform, flat areas.

Interface

General

Closely examine large areas of strong saturation with fine detail - such as the pattern on a colored shirt or the petal of a flower - as you switch between the RGB and L*a*b* spaces.

The following images demonstrate the effects of various types of noise reduction, exaggerated for clarity. While the source image does not contain any very-low-frequency noise, it was chosen because it does display the effects (and side-effects) very well.

Color Space

Noise reduction can be performed in the L*a*b* and RGB color spaces.

When working in the L*a*b* space, the L* channel is used for luminance and the a* and b* channels are used for chromaticity.

When working in the RGB space, the Y from the CIE XYZ color space is used for luminance and (X-Y) and (Y-Z) are used for chromaticity.

Mode

There are two general noise reduction "Modes" which control whether only high frequency or also low frequency noise is removed. Low frequency noise is noise whose blotches cover a large area; conversely, high frequency noise has smaller blotches which cover fewer pixels.

  1. Conservative - removes all except very low-frequency noise, so color detail is better preserved at the expense of not removing very large blotches. Use in most cases.
  2. Aggressive - removes also very low-frequency noise at the expense of being more aggressive with higher frequency noise. Use only on extremely noisy photos.

Gamma

Gamma varies noise reduction strength across the range of tones. Smaller gamma values let noise reduction affect all tones emphasizing the action on shadows, while higher gamma values limit the effect to brighter tones only.

Luminance

The Luminance Curve in RawTherapee-4.1 was used to completely remove noise in dark areas while fully retaining structure of lighter areas.

"Luminance control" lets you choose whether you want to manipulate the luminance noise reduction via sliders or a curve.

Adjusting the "Luminance" slider is equivalent to manipulating the amplitude of the luminance curve - both affect how strong the noise reduction effect is. The curve has the additional advantage of letting you control noise reduction strength as a function of the pixels' luminance - e.g. it allows you to have strong luminance noise reduction in the shadows and none in the highlights.

The "Detail recovery" slider allows you to recover structure while not reintroducing noise, unless you set this value too high.

Chrominance

Modes

Chrominance noise reduction can be performed using one of three or four modes, according to the chosen configuration in "Preferences > Performance & Quality > Noise Reduction":

Tool mode - Standard:

  • Manual
  • Automatic global
  • Preview

Tool mode - Expert:

  • Manual
  • Automatic global
  • Auto multi-zones
  • Preview multi-zones
Preview noise

The "Preview noise" indicator gives the estimated chromatic noise values after "Chrominance" processing:

  • Mean: estimates the average noise value across all channels.
  • High: estimate the highest noise value across all channels.

Mode: Manual

The three sliders and the curve act on the full image. You control the settings manually.

Master

Controls the strength of chrominance noise reduction. Functions as an offset independently to the red-green and blue-yellow values. For example if master=50, red-green=-50 and blue-yellow=-50, the end result is 0; no effect.

Red-Green

Reduce/boost noise reduction in the red-green channel (a* in L*a*b*).

Blue-Yellow

Reduce/boost noise reduction in the blue-yellow channel (b* in L*a*b*).


Chrominance curve

The chrominance curve lets you control chrominance noise as a function of the pixels' chrominance - e.g. it allows you to have strong chrominance noise reduction in areas of low saturation and weak noise reduction in areas of high saturation. This curve modulates the "Master", "Red-Green" and "Blue-Yellow" sliders' action by multiplying their values by the curve ordinate. For example, if the master slider is set to 30 and the curve is at mid-height, the equivalent result will be about 45. It can be useful for example in "Automatic global" mode to boost the grey or drab areas that will have a setting often too weak due to the settings average value. These grey areas are those where the visible noise become unpleasant, on the contrary to the very saturated areas where the same noise level (less visible) is acceptable.

Automatic global

The algorithm splits the image into multiple cells. For each cell the following are calculated:

  • An average noise level for the red-green channel and the blue-yellow channel.
  • A maximum noise level for the same channels.

Preview

This mode is only operational when zoomed to 100% or more. It analyzes the areas currently visible in the preview (if you are zoomed to 100% or more) and calculates:

  • An average noise level for the red-green channel and the blue-yellow channel.
  • A maximum noise level for the same channels.

The three sliders - Master, Red-Green and Blue-Yellow - as well as the "Preview noise" values, are updated accordingly.

If you would like to keep the currently calculated values then you should switch back to "manual" mode, else the values will be re-calculated when you pan or when you copy the profile to other images.

Auto multi-zones

Only available in "Expert" mode.

This mode is available chiefly to denoise images which cannot fit in RAM as a whole.

This mode is only operational when saving the output image - its affects are not visible in the preview regardless of zoom level!

The image is split into tiles. Each tile has a vertical and horizontal step of about 500 to 800 pixels. Depending on the image size and the chosen option in "Preferences > Performance & Quality > Number of tiles", the number of tiles can vary from 12 to over 120. Each of the three values are calculated separately for each tile, leading up to over 120 x 3 unique values. The tiles are blended at the seams to avoid artifacts if adjacent tiles' value differ strongly. This can be prevented via Preferences > Performance & Quality > Auto multi-zone smoothing":

  • None: each tile's values are completely independent of each other and of other tiles'.
  • Low: a part of the other tiles processing is taken into account, but in a weak way.
  • High: a part of the other tiles processing is taken into account more strongly.
  • Max: an average of all the tiles is used. This mode works like "Automatic global", but instead of using just 9 cells it uses all of the tiles (12 to over 120).

Preview multi-zones

Only available in "Expert" mode.

Identical to "Preview", but you have the possibility to evaluate with a very good approximation the result of "Auto multi-zones" with the help of the information given as a supplement to "Preview noise".

Under the label "Preview noise: Mean=x High=y", two lines are displayed:

  • The first one gives the tile size in pixels, and its center position on the full image.
  • The second one gives the preview size in pixels, and its center position on the full image.

The preview size depends on several parameters: zoom, lateral windows size.

You can adjusting the centers of the tiles and their size by panning the preview with the mouse and by modifying the zoom.

Median

The Median filter in RawTherapee-4.1 was used to eliminate artifacts which fit in a 3x3 window left over from the noise reduction process.
Comparison of noise reduction without and with median filtering, zoomed to 200%. While the filtered image on the right may appear less sharp, notice that the unfiltered image on the left does not really contain any more detail - the noise gives the illusion of sharpness. At the same time, the filtered image when saved to JPEG/92/standard was almost 40% smaller than the unfiltered one (350kB vs 215kB). RawTherapee-4.1.

Use this filter to remove tiny, sharp-looking artifacts left-over from noise reduction.

Median Type

The median filter replaces each pixel with the median value of its neighboring pixels. The contiguous group of pixels being sampled is called the "windows". This window slides pixel by pixel over the entire image. You can choose the size of this window using the "Median type" drop-down. The larger the size, the longer it takes.

Available window sizes:

  • 3x3 soft: treats 5 pixels in a 3x3 pixel window.
○●○
●●●
○●○
  • 3x3: treats 9 pixels in a 3x3 pixel window.
●●●
●●●
●●●
  • 5x5 soft: treats 13 pixels in a 5x5 pixel window.
○○●○○
○●●●○
●●●●●
○●●●○
○○●○○
  • 5x5: treats 25 pixels in a 5x5 pixel window.
●●●●●
●●●●●
●●●●●
●●●●●
●●●●●
  • 7x7: treats 49 pixels in a 7x7 pixel window.
●●●●●●●
●●●●●●●
●●●●●●●
●●●●●●●
●●●●●●●
●●●●●●●
●●●●●●●
  • 9x9: treats 81 pixels in a 9x9 pixel window.
●●●●●●●●●
●●●●●●●●●
●●●●●●●●●
●●●●●●●●●
●●●●●●●●●
●●●●●●●●●
●●●●●●●●●
●●●●●●●●●
●●●●●●●●●

Sometimes it is possible to achieve higher quality running several iterations with a small window size than one iteration with a large window size.

Median Method

You have five methods at your disposal:

  • Luminance only: works in L*a*b* mode, but only affects the L* channel.
  • Chroma only: works in L*a*b* mode, but only affects the a* and b* channels.
  • Weighted L* (little) + a*b* (normal): affects all channels in L*a*b* mode, but acts more weakly on the L* channel.
  • L*a*b*: affects all channels equally.
  • RGB: works in RGB mode. In this mode the window size choice is limited to 3x3 soft, 3x3 and 5x5.

When using the "Luminance only" and "L*a*b*" methods, median filtering will be performed just after the wavelet step in the noise reduction pipeline. When using the "RGB" mode, it will be performed at the very end of the noise reduction pipeline.

You may wonder what other uses median filtering has apart from the elimination of pixels which strongly differ from their surrounding neighbors for aesthetic reasons. One of these benefits is a reduction in file size when saving to compressed formats such as JPEG and PNG. Median filtering removes variations which you will lose anyway if you downscale the image. You are also likely not to see these variations if you print the image. Removing them using median filtering can reduce the file size by even 40% (tested using JPEG compression strength 92 with "balanced quality" chroma subsampling), so give it a try if output file size is a factor.

Finally, the "chroma only" median filter method can be used as a complement to automatic chrominance noise reduction calculation - by reducing sharp outliers it can soften the calculated values, thereby avoiding fading out color detail too much.