Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Bayer filter and demosaicing

The color-filter mosaic over a sensor's pixels, and the interpolation that reconstructs a full-color image from it.

Most camera sensors place a Bayer filter -- a repeating mosaic of red, green, and blue filters, with twice as many green cells as red or blue -- directly over the sensor grid, so each physical pixel records only one color channel. Demosaicing is the interpolation step that estimates the two missing color values at every pixel from its neighbors, reconstructing a full RGB image from the raw mosaic. The simplest version, bilinear interpolation, averages a missing channel's value from the nearest neighboring pixels -- at most four, directly up/down/left/right, called the orthogonal neighbors -- that actually recorded it.

Examples

  • A raw sensor reading of only red light at one pixel gets its missing green and blue values filled in by interpolating from the surrounding cells' own recorded colors.

Read the full section →
Graph settings

Calculator