Each one of the millions of pixels (also called a photosite) on a digital camera sensor is designed to do one thing: record the intensity of light striking it. That light value is sent to a processor and, along with the values of the millions of other pixels and their location on the sensor, the processor creates what is, essentially, a map of tonalities of the scene you photographed.
Your camera’s LCD screen or your computer’s display reveals that information as a digital photograph.However, if that was all that the camera sensor did, all of your digital photos would be black and white. To create color, each of the pixels is covered by either a red, blue, or green filter — the three primary colors of the additive color system. These filters are laid out in what is called a Bayer pattern — a design named after Bryce E. Bayer, the Kodak engineer who invented it. In the Bayer pattern, every other sensor on the grid is green. This is because the human eye is more sensitive to green light. When you use a combination of brightness and color information from each pixel (and take additional information from surrounding pixels),a color image is born.
It might seem impossible that a simple combination of three colors can create beautiful color images, but together in a JPEG image, they create an astounding 16.7 million potential colors (256 values of red × 256values of green × 256 values of blue). Interestingly, digital images are very similar to a painting done in the pointillism style, in which the artist creates an image made entirely of dots of paint. If you examine the image up close, all you see are dots of individual color. However, as you back away, those dots combine to create very realistic gradations and tonalities of color.