Meaning of Demosaicing


Today’s Question: What do you mean by the term “demosaiced” for raw captures that are converted to the DNG file format?

Tim’s Quick Answer: Demosaicing refers to the process of calculating the “other” two color values for each pixel in a raw capture, since the vast majority of cameras only capture one of the three RGB values for each pixel.

More Detail: While each pixel in a digital image is typically made up of three color values (generally red, green, and blue for an RGB image), nearly all digital cameras only record a single color value for each pixel. Most cameras use a Bayer pattern, where for each set of four pixels on the image sensor one pixel only records the red value, two pixels only record green values, and one pixel records blue.

For a raw capture, that original data is recorded without calculating the “other” values for each pixel. If you capture a JPEG image the sensor still only captures one color per pixel, but the other pixel values are calculated in the camera to create the JPEG image with full color information for each pixel.

Whenever the raw capture data is processed, the additional values need to be calculated. The raw data represents mosaiced data, meaning there is a mosaic of values that don’t represent the complete RGB pixel values. The missing values for all pixels are calculated based on the values for neighboring pixels. This process of converting the mosaiced data into full color information is referred to as demosaicing.