Demosaicing
Overview
 
A demosaicing algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

 is a digital image process
Digital image processing
Digital image processing is the use of computer algorithms to perform image processing on digital images. As a subcategory or field of digital signal processing, digital image processing has many advantages over analog image processing...

 used to reconstruct a full color image from the incomplete color samples output from an image sensor
Image sensor
An image sensor is a device that converts an optical image into an electronic signal. It is used mostly in digital cameras and other imaging devices...

 overlaid with a color filter array
Color filter array
In photography, a color filter array , or color filter mosaic , is a mosaic of tiny color filters placed over the pixel sensors of an image sensor to capture color information....

 (CFA). Also known as CFA interpolation or color reconstruction, another common spelling is demosaicking.

Most modern digital cameras acquire images using a single image sensor overlaid with a CFA, so demosaicing is part of the processing pipeline
Color image pipeline
An image pipeline or video pipeline is a term used to describe the components that are typically or commonly used between an image source , and an image renderer , or for performing any intermediate digital image processing...

 required to render these images into a viewable format.

Many modern digital cameras can save images in a raw format
RAW image format
A camera raw image file contains minimally processed data from the image sensor of either a digital camera, image scanner, or motion picture film scanner. Raw files are so named because they are not yet processed and therefore are not ready to be printed or edited with a bitmap graphics editor...

 allowing the user to demosaic it using software, rather than using the camera's built-in firmware
Firmware
In electronic systems and computing, firmware is a term often used to denote the fixed, usually rather small, programs and/or data structures that internally control various electronic devices...

.
The aim of a demosaicing algorithm is to reconstruct a full color image (i.e.
 
x
OK