Project

General

Profile

Demosaic plug-in

Introduction

The Demosaic plug-in forms part of the basic plug-in group and is used to transform the RAW file (CFA pattern, bayer for example) into an RGB image.

It is activated in the Darkroom only when zoom is greater than 50%, and it is also used when exporting an image.

TODO: Screenshot of the plug-in - insert screenshot here [use a close-up, showing all parameters of the relevant plug-in, but no items from other plug-ins - to avoid confusion]

This page is correct for the following stable versions of Darktable

  • v1.0.3
  • v1.0
  • v0.93

What this plug-in actually does

This plug-in determines the demosaicing algorith to use and its parameters, if one is used indeed.

Demosaicing is used if there's a need to compute an image with more than 50% magnification (on display or on export). Alternatively bilateral downsampling is used (it uses 2x2 blocks as single RGB pixels with some corrections for clipped pixels).

If High Quality resampling is activated then DT applies demosaicing, then the pixel pipeline at full resolution, then downscales the result as needed.

If High Quality resampling is not activated then DT applies bilateral downsampling or demosaicing depending on the situation (see avobe), then applies the pixel pipeline.

Parameters and settings that can be changed

The following parameters and settings can be changed within this plug-in:

  • method
  • edge threshold
  • color smoothing
  • match greens

method

This parameter determines the method to use: PPG or AMaZE

  • PPG is old, fast, and works with the GPU even faster
  • AMaZE is more expensive, can yield better results in hard cases, and sometimes has trouble when crop/rotate or opencl are switched on. It was originally developed standalone, then incorporated into RawTherapee, then ported to Darktable

edge threshold

This parameter sets the threshold for the median pass.

Possible values range from 0 to 1 in steps of 0.001

color smoothing

This parameter determines the number of passes for color smoothing.

Possible values range from 1 to 5 in steps of 1

match greens

This parameter sets the green correction, which is useful for some specific cameras.

Possible values are:

  • disabled
  • local average
  • full average
  • full and local average

Generally recommended settings for this plug-in

(TODO)

Whilst users may choose any settings they wish to create the look that they desire, the following settings are generally recommended for this plug-in.

Parameter method

Useful settings generally range from [25 to 75]. Lower values can lead to... and higher values will lead to....

Parameter edge threshold

Useful settings generally range from [25 to 75]. Lower values can lead to... and higher values will lead to....

Parameter color smoothing

Useful settings generally range from [25 to 75]. Lower values can lead to... and higher values will lead to....

Parameter match greens

Useful settings generally range from [25 to 75]. Lower values can lead to... and higher values will lead to....

[Other general comments about the parameters and their use (either alone, or in combination with one another)]

Example usage

(TODO)

Example 1

The [NAME] plug-in allows you to [manipulate/adjust/enhance/reduce/maximise/minimise/remove - delete as appropriate] VVVVVVVVVV to ....

In this example, you can see how the [NAME] plug-in [manipulates/adjusts/enhances/reduces/maximises/minimises/removes] ZZZZZZZZ and allows ....

Before photo screenshot - insert screenshot here
[Explanation of the original photo and what is hoped to improve/change]

Parameters used/suggested screenshot - insert screenshot here
[Explanation of the parameters used, and why - focusing on the reasons for using the values that you did.]

After photo screenshot to show changes - insert screenshot here
[Explanation of the photo following plug-in improvements and what has improved/changed]

NB.[Important to ensure that the before and after screenshots show only the effect of this plug-in, not a combination of other unspecified plug-ins or a stack of other adjustments. This example should focus on just the changes and improvements that can be achieved through the use of this plug-in. DELETE THIS TEXT ONCE THE EXAMPLE IS CREATED]

Example 2

The [NAME] plug-in allows you to [manipulate/adjust/enhance/reduce/maximise/minimise/remove - delete as appropriate] VVVVVVVVVV to ....

In this example, you can see how the [NAME] plug-in [manipulates/adjusts/enhances/reduces/maximises/minimises/removes] ZZZZZZZZ and allows ....

Before photo screenshot - insert screenshot here
[Explanation of the original photo and what is hoped to improve/change]

Parameters used/suggested screenshot - insert screenshot here
[Explanation of the parameters used, and why - focusing on the reasons for using the values that you did.]

After photo screenshot to show changes - insert screenshot here
[Explanation of the photo following plug-in improvements and what has improved/changed]

NB.[Important to ensure that the before and after screenshots show only the effect of this plug-in, not a combination of other unspecified plug-ins or a stack of other adjustments. This example should focus on just the changes and improvements that can be achieved through the use of this plug-in. DELETE THIS TEXT ONCE THE EXAMPLE IS CREATED]

[Insert other examples as required]

Caveats

The AMaZE method sometimes has trouble when crop/rotate or opencl are switched on.

See also

Darktable's online manual - 4.7 Demosaic

Relevant Blog entries concerning this plugin
  • [None currently available/Insert links here]
Online tutorials showing how to use this plug-in
  • [None currently available/Insert links here]
Online videos showing this plug-in in action
  • None currently available/Insert links here]

Wikipedia: Color Filter Array

Wikipedia: Demosaicing

Source code

Also available in: PDF HTML TXT