Megapixels with Bayer Pattern

Facebooktwitterlinkedin

Today’s Question: My new camera specifications state that it features 45 megapixels. I understand there is a Bayer pattern, grouping 4 pixels with color filters effectively into one. So, does my camera 180 million pixels in 45 million groups of 4 or some other amount?

Tim’s Quick Answer: Your camera has 45 million photosites on the image sensor, resulting in an image with 45 million pixels (megapixels). Interpolation is used to calculate the “missing” color values for each single-color photosite.

More Detail: The number of megapixels specified for a digital camera generally relates to the number of photosites on the image sensor, and by extension the number of megapixels in the final image. Most images sensors employ a Bayer pattern design, where for each grid of four photosites on the sensor one will capture red light, two will capture green light, and one will capture blue light. But that grid represents four individual pixels in the final image, not four values that get combined into a single pixel.

When the raw capture is rendered, a demosaicing process calculates the “missing” color values for each pixel through interpolation. For the pixels that only recorded a red value, for example, the green and blue values must be calculated. This might seem improbable, but it makes more sense when you consider that the green and blue values for a photosite that only recorded red light is calculated based on neighboring green and blue photosites, not arbitrarily based on the red value.

In the vast majority of camera image sensors there is only one photosite on the sensor for each pixel in the final image. There are some exceptions to this. For example, the sensors original developed by Foveon used a specialized photosite construction where all three color values (red, green, and blue) were captured by each photosite.

There are other variations on the traditional image sensor structure that involve more than one photosite per pixel, such as sensors from Fujifilm that employed two sensors per pixel for increased dynamic range. In other cases, different technologies are used to enhance the image data captured by the sensor. For example, the Fujifilm Pixel-Shift Multi-Shot technology enables a camera to capture a series of images with the image sensor shifting position slightly between captures to produce an image with higher resolution and color fidelity than would otherwise be possible.