Noise reduction in Darktable
Last updated: 1 January 2019
Table of contents:
- Method suggested in documentation
- Comparison video by Robert Hutton
- Denoising styles from William Ferguson
- Denoising presets of His Dudeness
- Denoising style from Aurelien Pierre
- Chroma denoising technique using Lowpass module
- Other variations
- Comparison with RawTherapee
- Tutorial video by Bruce Williams
- Improvements in Darktable 2.6
- Masterclass on denoising in Darktable 2.6
- High ISO exercise files
Reducing noise in a photograph can be a complex task. Some applications offer one-size-fits-all solutions to keep user choices (and possible confusion) limited. Darktable seems to offer a range of modules suitable for the task. Using them efficiently can feel a bit daunting:
- Denoise – profiled
- Denoise – non local means
- Denoise – bilateral
- Raw denoise
Some photographers include other modules as part of their noise reduction procedure too:
- Demosaic - changing parameters can impact especially chroma noise.
- Hot Pixels - with aggressive parameters can help remove outlier pixels.
- Lowpass - to reduce chroma noise, see denoising styles from William Ferguson and this video.
- Sharpen - to help recover detail lost in denoising process. See video by Robert Hutton. Section on this module starts at 12:38. It is important to adjust parameter Threshold.
- Dithering - see denoising style from Aurelien Pierre.
- Grain - after applying aggressive noise reduction images often lack detail and can look cartoonish. By adding grain we can create an illusion of more detail in the image.
Intention of this article is to provide some useful pointers in one place. Note that the article was initially written for Darktable 2.4. In December 2018 version 2.6 came out which contains some improvements for Denoise – profiled module. Make sure you watch the video by rawfiner to learn many useful tricks and techniques for denoising in this new version.
Method suggested in documentation
Quoting from official Darktable documentation talking about Denoise – profiled module:
This module can eliminate noise with two different core algorithms. “non-local means” is a bit better suited to tackle luma (lightness) noise; “ wavelet” has its strength in eliminating chroma (color) noise. If needed you can apply two instances of this module (see Section 3.2.4, “Multiple instances”). The “non-local means” instance should be combined with blend mode “lightness” or “HSV lightness”; the “wavelet” instance with blend mode “color” or “HSV color”. For more information on blend modes have a look at Section 3.2.6, “Blending operators”.
I have setup in my Darktable two new presets for Denoise – profiled module as per the description above. Using presets is faster then setting things up every time. I named them step 1 - wavelets / color and step 2 - non-local means / lighten. It is worth mentioning that the order of the modules in the processing pixelpipe matters in this case, so you can experiment which order works better for you. I also found this ticket in Darktable's issue tracking system asking for a method to process these steps in parallel, without influencing each other. But at least for now we need two steps:
I found it useful to add some aggressive settings for hot pixels removal too:
I have tested this method on one of my photos taken with Nikon D7100 at ISO 1600. You can download the raw file if you want to experiment yourself. Here are small samples at 100% magnification. Click on any of them to get a larger cut:
|Original||Denoised||Plus Hot Pixels|
Comparison video by Robert Hutton
See it below or on Robert's website. Demonstrates use of the method suggested in the documentation and gives brief overview of the other available denoising modules. He even compares it to proprietary NoiseNinja used in AfterShot Pro:
Denoising styles from William Ferguson
Darktable modules settings can be combined into and applied using styles. Here a Darktable user shared his personal noise reduction styles (scroll down on that page to his .dtstyle files, there are 4 files to download). You can try them as a starting point for your own images or styles.
In his post he described his workflow:
I usually shoot in manual, so all my exposures are pretty much the same. I denoise one image, then copy the history stack and paste it to the rest of the images. If I was changing exposure settings, then I denoise one image per group, and copy the history stack to the rest of the group.
I have imported these files in my Darktable styles and renamed them so that they all start with "Denoise". This way they show all together among my other styles (to rename a style use edit function):
I have tested the styles on one of my photos taken with Nikon D7100 at ISO 1600. Here are small samples at 100% magnification. Click on any of them to get a larger cut:
|Original||Low ISO||Medium ISO||High ISO||Very High ISO|
Bill also shared another useful trick:
When you denoise a very high ISO image, the loss of detail gets pretty bad sometimes. I've found if you add some grain in, it helps trick the eye into thinking there's more detail there than there really is.
Denoising presets of His Dudeness
A user on DP Review Forums documented his presets, see details here. They include following tips:
- Using module Equalizer, Chroma tab - for not too heavy chroma noise reduction.
- Using module Denoise - Profiled in non-local means mode, patch size 4, blend mode average, and parametric mask effecting shadows more than highlights. He suggests this is suitable for normal and moderate luminance noise. Should also remove some chroma noise.
- Using module Denoise - Profiled in wavelets mode, blend mode average, 75% opacity, and parametric mask effecting shadows more than highlights. He suggests this is suitable for stronger luminance noise.
- His last tip is identical to my step 1 as per the method described in official documentation.
Denoising style from Aurelien Pierre
Referred from this DP Review forum thread, the style can be downloaded from here. The original thread is in French. You can get automatic translation to English here. Aurelien Pierre is one of the Darktable developers with interest in maths for image processing (based on his forum profile).
The style seems rather elaborate and slows image processing. It includes 9 module instances:
Chroma denoising technique using Lowpass module
Here David LaCivita explains another technique of removing chroma noise using two Lowpass module instances with blending modes Lab a-channel and Lab b-channel. This is then combined together with the method described in official documentation. The first part of that video talks about Haze Removal module if you are interested in.
Jack Bowling suggests to use Denoise – profiled module with blend mode multiply and adjust opacity to taste.
Comparison with RawTherapee
I noticed some claims that noise reduction in RawTherapee is superior to that in Darktable (see for example here). I wanted to do a brief comparison myself. So I processed my test shot reasonably close in both and applied noise reduction with out-of-the-box parameters. For Darktable side I used 3 different methods, again without any parameter tweaks for simplicity:
- Method suggested in the documentation plus Hot Pixels.
- Style from Aurelien Pierre plus Hot Pixels.
- Medium ISO style from William Ferguson.
- I used AMaZE demosaic method in both cases.
- RawTherapee has by default following setting turned on: Raw > Sensor with Bayer Matrix > Chromatic Aberration > Auto-correction. This seemingly reduces chroma noise while altering colour cast of some parts of the image. To get a closer comparison, I have turned it off.
- Noise reduction in RawTherapee included both Impulse Noise Reduction and Noise Reduction.
Small cuts in 100% magnification to compare are below. Please click on each to get larger area:
|RT base||RT with NR||DT base||DT NR #1||DT NR #2||DT NR #3|
Conclusion: My example didn't show any dramatic advantages of RawTherapee's noise reduction. Though it is always a matter of taste as well as fluency with a particular tool. RawTherapee certainly makes it more accessible out-of-the-box, while getting good results with Darktable requires at least to read the documentation.
Tutorial video by Bruce Williams
Bruce in this video goes over 6 different methods of noise reduction in Darktable. Some of the noise he describes is hard to see in the compressed youtube video but you get the idea from his description. His favourite to tackle noise in photos shot at high ISO is combination of modules denoise (profiled) and denoise (bilateral filter):
Improvements in Darktable 2.6
There are new options available in denoise (profiled) module in Darktable 2.6 as well as two presets out of the box:
- chroma (use on 1st instance)
- luma (use on 2nd instance)
These presets supersede original recommendation from Darktable's documentation as described above. How does the new recommendation compare to the old one? Here they are side by side applied to my ISO 1600 shot I used in other comparisons above (click on previews to see larger images):
|No denoise||Old suggestion||New suggestion|
I find the new recommended settings more pleasing since they better preserve fine detail but remove more of the coarse grain noise. To further fine-tune the result you might want to check introduction on how to use the new wavelet decompose curves in wavelets mode.
Masterclass on denoising in Darktable 2.6
User rawfiner posted on youtube a video describing how to use new Darktable 2.6 denoise features plus lots of other useful denoising techniques, especially for very high ISO images:
To make it easier to find specific detail, I have created a table of content for this video. First part deals with easy cases and uses image shot with ISO 6400 as an example:
- 00:00 - Introduction
- 01:04 - Zoom to 100% when working on denoising your images.
- 01:57 - Using new presets for denoise (profiled) in Darktable 2.6, example image ISO 6400.
- 02:40 - Bug/hack (?) - disable highlight reconstruction module to help denoise module work on colour channels based on red/green/blue multipliers in white balance. Using color reconstruction is fine and won't interfere here. This behaviour is likely to get fixed in future versions.
- 05:07 - Manipulating new wavelet decompose curve in denoise (profiled) module. For more information see also here.
- 07:06 - Use equalizer to boost local contrast a little bit.
- 07:41 - Changing opacity to control level of denoising.
Second example photo shot at ISO 25600:
- 08:14 - Second example image: ISO 25600. Disable color reconstruction, then use two instances of denoise (profiled) and equalizer to boost local contrast.
- 09:12 - Use equalizer to further reduce chroma noise.
Third example photo shot at ISO 51200 and a stop of underexposure, more advanced techniques:
- 09:43 - Third example image: ISO 51200 plus one stop underexposure. More advanced techniques will be described.
- 10:13 - Using channel mixer with destination gray and setting red, green, and blue multipliers one by one to visualise noise in each colour channel.
- 10:59 - Denoising channel by channel: Set channel mixer with destination gray and the most noisy channel. Then adjust denoise (profiled) in wavelets mode for that colour channel.
- 12:52 - Adding second instance of denoise (profiled) to further reduce chrominance noise. Alternatively use equalizer to do the same. Optionally also dull edges in equalizer.
- 13:40 - Another method: Keeping just the first instance of denoise (profiled) (which was setup channel by channel). Then set input color profile to linear Rec709 RGB, compensate by increasing saturation in contrast brightness saturation module.
- 14:41 - Optionally use RGB curves in raw denoise module.
- 14:45 - Use hot pixels module, set threshold to 0 and strength to 1, could also use detect by 3 neighbours.
- 15:25 - Explanation of slider search radius in non-local means mode of denoise (profiled) module. Good for coarse grain noise, the higher the radius the better but it increases computation complexity quickly (it is function of radius square). Consider this an emergency use only.
Using denoise (bilateral filter) module and more advanced techniques:
- 17:38 - One last method with denoise (bilateral filter) module. This is demonstrated from the starting point of the third image file, with only exposure increase applied. Using the same trick of looking at separate colour channels with help of channel mixer. Starting point for channel multipliers in denoise (bilateral filter): 0.5 for the most noisy channel and 0.3 for the other channels.
- 18:33 - Not working too well on this image. How to fix it: Remove one stop exposure compensation, remove base curve, and use tone curve to achieve similar tonality. That comes after denoising in pixel pipeline so the denoising, which is a useful trick.
- 19:20 - Re-enable denoise (bilateral filter), increase its radius to deal with coarse grain noise. Still on first (most noisy, here blue) channel.
- 19:52 - Do the same process for green and red channels.
- 20:33 - Deal with remaining colour noise using equalizer.
- 20:55 - Fine-tuning radius in denoise (bilateral filter) for separate channels by using a second instance and blend mode RGB blue channel.
- 22:27 - Why we should use equalizer to remove remaining chroma noise and not denoise (profiled). This has to do with the latter introducing interaction among colour channels and preventing denoise (bilateral filter) from working on isolated channels.
- 23:19 - Closing note on denoise (bilateral filter) use, especially suitable for high noise images, and when one colour channel is much more noisy than the other two.
- 23:40 - Last two tips: Use colour smoothing in demosaic module.
- 24:03 - Use lowpass module to deal with bright pixels in dark areas. Blend mode darken, radius 1, brightness 0.50.
- 25:05 - Similarly use lowpass module to deal with dark pixels in light areas. Blend mode lighten, radius 2, brightness -0.20.
- 25:37 - Optionally remove sharpening or lower its opacity. Note that lowpass comes after sharpening in pixel pipeline.
- 26:12 - Things to remember: Use 100% zoom level, use channel mixer to look at each colour channel separately. Use provided presets for denoise (profiled) if your photos are not too noisy.
High ISO exercise files
I was intrigued by rawfiner's video and I decided to play with these techniques myself. So I shot some exercise files with Nikon D7500 at ISO 6400, 12800, 25600, 51200, and 102400 (Hi 1.0). Higher ISO values turned out not usable at all. To make the files smaller I used 1.3x crop and 12-bit lossless compressed NEF format. Why 12-bit? Thom Hogan argues in his Nikon D7500 guide that when shooting above ISO 400, differences between 12 and 14-bit lossless compressed NEF files are imperceptible for this camera.
You are welcome to download my raw and xmp files (zip file 84 MB) and see what results you manage to get!
The first table shows how far I got removing noise from the files using denoise (profiled) and a few other tricks as the noise level was increasing. You are looking at a small section of the image at 100% magnification. Please click on the tiles to see large files (or right-click and save them to your computer):
Naturally the results are a matter of taste. There is always a trade-off between noise removal and making the image too smooth and unnatural looking. I found the last one a bit in that category and wasn't able to get a better result. So I tested the other method: denoise (bilateral filter) module. Here are two results - one with a single instance of denoise (bilateral filter) module used and the other with two. There were other tricks applied too. The second table shows them side by side with the base image and the result of denoise (profiled) as per above:
It is important to examine noise when zoomed in to 100%. If you want to try this exercise yourself, feel free to download my raw and xmp files (zip file 84 MB) and have a play. I hope this practice helps you improve your processing skills and confidence.
Please let me know if you notice any issues in this article.
Noise reduction in Darktable by Tomas Sobek is licensed under a Creative Commons Attribution 4.0 International License.