Grayscale Images

This page shows how the conversion of a Bayer pattern image to an RGB image manages to preserve color accuracy in areas of uniform color, but leads to distortions where there are rapid changes in color. To make the problems introduced by the process more obvious, I've used a grayscale image. In this image, for each pixel, the R, G and B components have the same value, which means each pixel is displayed as a shade of gray.

Below are the original image, the Bayerized version, and the DeBayerized version. You can see than in the 'flat' area of the nose, the gray level is fairly undistrubed, with a slight loss of detail. However, around the nostrils, which are much darker than the surrounding areas, there is noticeable color fringing.

Discrete Pixels

The next set of images below shows for individual pixels how the DeBayerizing process works. The single pixels re centered on red, green and blue pixels in the Bayer pattern. You can see that it's not till you get to a 3 x 3 white square that the 'recovered' version has any white pixels at all, just a single one in the center. Note also that the white patterns grow by two pixels in each direction when recovered, which explains the loss of detail you get when de-Bayerizing.

Coming next...

A better de-Bayerizing algorithm.

Part I: Bayer Patterns in Digicam CCDs