How digital camera sensors record light
On a digital camera sensor, there are millions of pixels (a 1MP sensor has 1,000,000 pixels). Each pixel has a photosite, a cavity that is uncovered when you press the shutter release button. At the end of an exposure, the camera closes each photosite and works out how many photons fell in to each cavity. The camera then determines the intensity of each pixel, depending on how many photons were in the photosite.
However, each small cavity can’t distinguish how much of each color has fallen in, so the sensor can only record gray scale images. To record color pictures, a filter called a Bayer mosaic is placed over the sensor.
The Bayer mosaic filter only allows light of a certain color to reach each cavity. The Bayer mosaic consists of three colors of small filter – red, green and blue. There are twice as many green filters in a Bayer mosaic to accurately reflect the way the human eye sees color – it is more sensitive to green light. The array only passes the intensity of one of the three colors in each cavity to the sensor. Once all of the colors are put together, an image is made.