Demosaicing

Demosaicing (also spelled demosaicking) is the computational process that turns the raw single-color samples from a camera sensor into a full-color image where every pixel has red, green, and blue values. It is necessary because most sensors do not measure color directly. Instead, each photosite sits beneath one colored filter and records only the brightness of that one color.

The overwhelmingly common arrangement is the Bayer filter, a repeating mosaic of red, green, and blue filters with twice as many green sites as red or blue, mimicking the eye’s greater sensitivity to green. Because each pixel on the sensor knows only one of the three colors, the missing two values at every location must be estimated from the neighbors. That estimation by interpolation is exactly what demosaicing does. Some makers use different mosaics, such as Fujifilm’s X-Trans pattern, which need their own demosaicing algorithms.

This step is the heart of converting a RAW file into a viewable picture. When you open a raw file in Lightroom, Capture One, or any converter, the software demosaics the sensor data before applying white balance, tone, and color. Different converters use different demosaicing algorithms, which is a major reason the same raw file can look slightly sharper, cleaner, or more detailed depending on the software that processed it. It is also why a fresh camera model sometimes looks soft in older software that has not yet been updated for its sensor.

Algorithm quality shows up most at fine, high-contrast detail and along diagonal edges. Simple methods can produce color fringing, a zippering pattern along edges, and maze-like artifacts, while more sophisticated adaptive algorithms examine local gradients to place detail more accurately. The trade-off is processing time, which is why in-camera JPEG demosaicing is faster and simpler than the best desktop converters.

Demosaicing is also where moire and false color can appear, when scene detail approaches the spacing of the filter grid. This is the same sampling problem that aliasing describes, and it is why some cameras place an optical low-pass filter over the sensor to blur detail very slightly before it is sampled. The interaction with sharpening matters too, since sharpening applied after a weak demosaic amplifies its artifacts.

Cameras that capture full color at every pixel, such as those using pixel-shift multi-shot modes or stacked three-layer designs, sidestep demosaicing for those captures and can resolve more genuine detail and cleaner color. For the vast majority of images, though, demosaicing remains an invisible but decisive step that shapes sharpness, color accuracy, and the overall character of the final file.

For photographers, the practical takeaways are simple. Shoot raw to keep the demosaicing decision in your hands rather than baking in the camera’s version, try a different converter if a file looks unexpectedly soft or shows color fringing, and remember that the impressive sharpness of a modern camera owes as much to its demosaicing and processing as to the lens and sensor themselves.