Saturday 28 March 2009

Capturing light - digital sensors and histograms

For further photography-related information check out my compendium of tips.

Each pixel in a digital image has a corresponding light-collecting 'photosite' on the sensor of the camera that took it (on the 5D Mark II there are 5616 x 3744, or 21 million, of them!) In the majority of digital cameras each photosite can only record light intensity for one of the primary colours (red, green and blue), assigning it a number between 0-255 (256 values = 2 to the power of 8 = 8-bit). For each photosite information about the other two primary colours is deduced from adjacent photosites using a process known as 'demosaicing'. The Foveon sensor, featured in Sigma's cameras, is the exception - it records the intensity of R,G & B light at each photosite. This information can then be converted and displayed as a digital image or graphically as a histogram.


I took the above 'snap' of my daughter Emily this morning, deliberately including some vibrant primary-coloured objects, to give clear histograms.


Pressing the 'info' button whilst the image is displayed on the LCD of the 5D Mark II gave the above screen which shows a brightness, or luminance, histogram.


Pressing the 'info' button again leads to separate histograms for R, G & B light (the order in which these screens are displayed can be adjusted by a setting in the menus).


In Photoshop the above histograms can be displayed for the image - the 'RGB' and 'colours' histograms are in addition to those that the camera displays.

The horizontal axis on all these histograms represents brightness values which run from 0-255. The vertical axis represents the number, or frequency, of pixels occuring with this brightness value.

It is not always possible to expose a shot so that it is cleanly captured within the brightness range of these histograms - the dynamic range can be too great for the camera (think outdoors on a bright sunny day). In this case some of the tonal detail of the shot will be lost or 'clipped' - it will be either pure black or pure white. One of the benefits of shooting RAW is the greater tonal range that can be captured.

I tend to pay most attention to the brightness, or luminance, histogram as it corresponds most closely to the scene as our eyes see it (the 5D Mark II displays a luminance histogram but many cameras only display the RGB variant). The histogram is calculated by taking a weighted average of the R, G & B light at each pixel, with more emphasis placed upon green light as the eye is most sensitive to this. As a result, notice that the luminance histogram bears most resemblance to the green-only histogram.

The separate colour histograms can be used to see if individual colours have been clipped.

The RGB histogram is purely a summation of the colour histograms and can be used to assess colour clipping - but as a result of this simple maths, 'pixel location information' is lost. The histogram can show strong clipping at the far right of the histogram, due to bright R, G and B pixels at separate locations, without there being any pure white pixels in the image. A white pixel requires values of 255 for all three colours at the same location.

The 'colors' histogram is an overlay of the separate colour histograms and is a convenient way of visualising all three at once - Lightroom displays this.

How this colour and brightness information can be manipulated will be the subject of further posts.

Check out my photography here: Kent photographer

No comments: