How the Bayer pattern is arranged

A silicon photodiode senses only light intensity and cannot distinguish colors. Color image sensors therefore place a red (R), green (G) or blue (B) color filter over each pixel. The Bayer pattern takes a 2×2 block of pixels as its unit, with two greens on the diagonal and one red and one blue, and repeats it horizontally and vertically. The greens form a checkerboard, while red and blue each occupy every other row and every other column. It was devised and patented by Bryce Bayer of Kodak, and is used in almost all color image sensors.

Why there are two greens

The human eye is most sensitive to green light, and the green wavelength range accounts for much of how we perceive brightness (luminance). Perceived image detail comes mainly from luminance changes, so having more green pixels raises perceived resolution for the same pixel count. On the other hand, the eye resolves color changes less finely than luminance, so having fewer red and blue pixels has a relatively small effect on perceived image quality. However, because each pixel measures only one color and red and blue pixels each make up only a quarter of the total, color resolution is lower than the pixel count suggests.

Demosaicing and false color

RAW data read straight from the sensor holds only one color value per pixel. The camera's image signal processor (ISP) estimates the two missing colors from neighboring pixel values so that every pixel has all three RGB values. This is demosaicing (color interpolation). Simple averaging produces colors that are not really there (false color) and jagged edges, so methods that interpolate along detected edge directions, or AI-based methods, are used. Fine stripe patterns easily produce false color and moiré, so some cameras place an optical low-pass filter in front of the sensor to blur overly fine detail slightly.

Variants such as Quad Bayer

In high-resolution smartphone sensors, pixels have shrunk to around 1 µm or smaller, and sensitivity per pixel tends to be insufficient. Arrangements such as the Quad Bayer pattern are therefore used, in which same-color pixels are grouped in 2×2 (or 3×3 or 4×4) clusters and the clusters are laid out in the Bayer arrangement. In dark scenes, same-color pixels are read out together as one pixel (binning) to raise sensitivity, while in bright scenes a remosaic process that rearranges the pixel pattern produces a high-resolution image. There are also arrangements that add white (W) pixels without color filtering to raise sensitivity.

Try it: questions about Bayer pattern

In a Bayer color filter array, which color appears most often in each 2×2 block of pixels?

  1. ARed
  2. BBlue
  3. CGreen
Show answer and explanation

Answer: C. Green

A Bayer pattern places one red, one blue and two green filters in each 2×2 block. The eye is most sensitive to green and derives most luminance information from it, so doubling green improves perceived resolution. Each pixel's two missing colors are interpolated from neighbors (demosaicing). Invented by Bryce Bayer at Kodak, it is used, as is or in modified forms, in many color sensors.

FAQ

Why does the Bayer pattern have more green?

Because the human eye is most sensitive to green light and gets much of its brightness information from green. Placing two greens and one each of red and blue in each 2×2 block raises perceived resolution for the same pixel count.

What is demosaicing?

Because each pixel in a Bayer pattern has only one color value, demosaicing estimates the two missing color values from neighboring pixels so that every pixel has RGB values. It is also called color interpolation and is an important step in camera image processing.

What is the difference between the Bayer and Quad Bayer patterns?

The Bayer pattern places one red, two greens and one blue in each 2×2 block of pixels. The Quad Bayer pattern groups same-color pixels into 2×2 clusters and arranges those clusters in the Bayer layout. In dark scenes, four pixels are combined to raise sensitivity, and in bright scenes the sensor can be used at high resolution.

Books on Image sensors and optical devices Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary