tezvyn:

Bayer Filter: Faking Full Color with a Filter Grid

AI-drafted, machine-checkedSource: Wikipedia: Bayer filteradvanced
Bayer Filter: Faking Full Color with a Filter Grid

A Bayer filter is a hack for capturing color with one sensor: a checkerboard of red, green, and blue filters is placed over the sensor grid. This is how most digital cameras work. The footgun is that the raw output must be 'demosaiced' to create.

WHY IT EXISTS Building a sensor where every single pixel can detect full RGB color is complex and expensive. It is far more cost-effective to use a standard monochrome sensor and place a filter on top that allows each pixel to see only one color, then reconstruct the full-color image in software.

THE MENTAL MODEL Think of a camera sensor as a grid of buckets catching rain (photons). A Bayer filter is like putting a colored lid on each bucket—some red, some green, some blue. Each bucket now only measures the amount of one color of rain. To know the full 'color' of the rain at any point, you have to look at the measurements in neighboring buckets and make an educated guess.

HOW IT WORKS A Color Filter Array (CFA), most commonly a Bayer filter, is laid over the sensor grid. The pattern is a repeating 2x2 mosaic containing one red, one blue, and two green filters (e.g., RGGB). It has double the green filters because the human eye is most sensitive to green light. The sensor captures a grid of single-color intensity values. This raw data is not a viewable image. A software process called 'demosaicing' or 'de-Bayering' then runs. For each pixel, it interpolates the two missing color values by looking at the colors of its neighbors. For example, for a green pixel, it estimates red and blue values from the nearest red and blue pixels.

WHEN TO USE IT This is the fundamental technology inside almost every single-chip digital camera, from smartphones to DSLRs and camcorders. It provides a cost-effective method for capturing color images that are very high quality for most purposes.

WHEN NOT TO USE IT High-end scientific or cinema cameras may use more expensive methods to avoid demosaicing artifacts. These include using three separate sensors (one per color, combined via a prism) or specialized sensors like Foveon that capture all three colors at each pixel site. Also, for dedicated black-and-white photography, some cameras omit the color filter array entirely to maximize sharpness.

ONE CANONICAL EXAMPLE A 24-megapixel camera with a Bayer filter does not have 24 million full-color pixels. It actually has 12 million green-sensitive photosites, 6 million red, and 6 million blue. The final 24-megapixel RGB image you see is a software reconstruction from this raw mosaic data. This conversion is a primary step in all RAW photo processing software.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.