demosaic

Control how raw files are demosaiced.

🔗bayer filters

The sensor cells of a digital camera are not color-sensitive – they are only able to record different levels of lightness. In order to obtain a color image, each cell is covered by a color filter (red, green or blue) that primarily passes light of that color. This means that each pixel of the raw image only contains information about a single color channel.

These color filters are commonly arranged in a mosaic pattern known as a Bayer filter array. The demosaic algorithm reconstructs the missing color channels by interpolation with data of the neighboring pixels. For further reading see the Wikipedia articles on the Bayer filter and Demosaicing.

Demosaic interpolation algorithms are often prone to produce artifacts, which are typically visible as Moiré-like patterns when zooming into the image. Various demosaic algorithms have been developed in an attempt to overcome these artifacts. Currently darktable supports PPG, AMaZE, and VNG4 demosaic algorithms for Bayer filters. AMaZE is reported to sometimes give slightly better results. However, since AMaZE is significantly slower, darktable uses PPG by default. VNG4 produces the softest results of the three algorithms, but if you see “maze” artifacts with the other algorithms, try using VNG4 to eliminate them.

🔗sensors without bayer filters

There are a few cameras whose sensors do not use a Bayer filter. Cameras with an “X-Trans” sensor have their own set of demosaic algorithms. The default algorithm for X-Trans sensors is Markesteijn 1-pass, which produces fairly good results. For slightly better quality (at the cost of much slower processing), choose Markesteijn 3-pass. Though VNG is faster than Markesteijn 1-pass on certain computers, it is more prone to artifacts.

Additionally, darktable supports a special passthrough (monochrome) demosaic algorithm. This algorithm is only useful for cameras which have had the color filter array physically removed from the sensor (e.g. scratched off). Normally, demosaic algorithms reconstruct the missing color channels by interpolation with data of the neighboring pixels. However, if the color filter array is not present, there is nothing to interpolate, so this algorithm simply sets all the color channels to the same value, resulting in a monochrome image. This method therefore avoids the interpolation artifacts that the standard demosaic algorithms might produce.

🔗module controls

method
The demosaic algorithm to use (see above).
edge threshold (PPG only)
The threshold for an additional median pass. Defaults to “0” which disables median filtering.
color smoothing
Activate a number of additional color smoothing passes. Defaults to “off”.
match greens
In some cameras the green filters have slightly varying properties. This parameter adds an additional equalization step to suppress artifacts. Available options are “disabled”, “local average”, “full average” and “full and local average”. This option is not shown for X-Trans sensors.