How a digital sensor works, Pt 2
Photo-electric elements used in a camera sensor to create an image are often called 'pixels'. 'Pixel' is short for 'picture element'. The pixels are very small. In a 12MB, full frame digital sensor, the array of pixels would be 4230 x 2820 fitting onto a space that is approximately 36mm x 24mm.
When we make a photograph, such as this one of my dog in the mountains, the image of the dog is cast onto the sensor with each pixel registering the amount of red, green, or blue in the colour of the 'spot' in the image that falls on it.
The 'brown' light at a spot in the dog's eye is filtered and recorded (on the pixels beneath) as being made up of a certain amount of red, some green, and (in this case) very little blue.
A 'raw' digital file is little more than a set of numbers representing the intensity of the red, green, or blue light components that were measured by each pixel in the sensor.
Making a picture from 'dotty' data
To reassemble the picture, software in the camera, or a computer application called a raw converter, undertakes a process called 'demosaicing'. The software calculates the true colour that must have been incident on the filter, by estimating the colours that were filtered out and then recombining them.
For example consider the pixel labelled 'R' in the diagram here. A simple way to calculate the 'before filter' colour of the light that is measured at 'R', would be to take
Demosaicing procedures are usually more spohisticated than the example given here but the idea is to get an R,G,B value for each pixel in the image data file.
The image file, now represented in an RGB colour model, consists of a set of number triples, representing the amounts of red, green, and blue calculated for each pixel in the sensor.