How a camera fills in the colors between its measurements

A digital sensor is covered by tiny light-sensitive sites, often called photosites. In a common design, each site has a filter that lets through mostly red, green, or blue light. The resulting pattern contains many separate brightness readings—but at any one location, the sensor has measured only one color channel.

To make a full-color image, the camera’s processor reconstructs the other two channels at each location. This process, called demosaicing, uses nearby readings as clues. If a red-filtered site sits among green and blue sites, for example, the processor estimates the missing green and blue values from the surrounding pattern. It then combines the estimates into an RGB pixel.

The estimate depends on the scene

The simplest approach would average nearby measurements. But real cameras use more sophisticated methods because a flat patch and a sharp edge should not be treated alike. Across a smooth area, neighboring values are likely to be similar. At an edge, averaging across the boundary can blur detail or create a colored fringe. Processing algorithms therefore try to detect patterns and preserve edges while filling the gaps.

That reconstruction is only one step in turning sensor readings into a photograph. The camera also adjusts color and contrast so the result looks natural on a screen. The final image is thus not a direct record of a separate red, green, and blue measurement at every point; it is a carefully calculated interpretation of sparse samples.

When the guess becomes visible

Most scenes give the processor enough neighboring information to produce convincing color. Very fine repeating patterns—such as woven fabric or a distant roof—can exceed what the sensor’s sampling pattern can resolve. The reconstruction may then invent wavy bands or false colors, artifacts known as moiré. In other words, the camera’s color-filling trick works best when the scene changes gradually enough for its neighboring clues to be reliable.