Sunday 2 November 2014

Birds and Light - Image Lighting Tools

Grey is the new Black...and the new White

Black and white paints are rarely applied neat to canvas because, one of the first things we are thought in art class is that highlights and shadows usually contain some colour.  In art, black is mixed with a colour paint at various concentrations to create various shades of that colour.  Similarly white paint is added to create tints.  The same basic principal applies to our digital colour pallet and to our photographs.   To adapt an old adage, nothing in life is ever black and white, it exists in shades of grey...256 shades to be exact in the context of a standard digital image.

Tonal Range and Contrast Ratio
In sRGB colour space we have 256 discrete tones from black to white.  This means the contrast ratio of sRBG colour space is 256:1.

Note: For some reason there are only 241 luminosity increments in MS Paint.  In Adobe Photoshop there are only 100 luminosity increments, as luminosity is measured as a percentage in that software.  However there are in fact 256 discrete tones, and these increments can be individually reproduced using RGB values rather than using luminosity sliders.  In the image below I have reproduced all 256 discrete tones as a 16 X 16 grid.  For more on contrast ratio see HERE and for more on tonal range see HERE.

In printing terms white and black are called DMIN and DMAX respectively.  They represent the minimum and maximum densities of ink that can be applied to a given paper.  DMIN and DMAX can be measured using a densitometer, used for example in the photofinishing industry to calibrate printers for different paper stock and to account for variations in print quality due to process chemistry.

Challenges in reproducing tones accurately
I created the test image below using MS Paint.  The background is sRGB white (level 255, or R=255;G=255;B=255).  The lower right hand target is sRGB black (level 0, or R=0;G=0;B=0).  The other targets are luminosity = 60 (level 63) , 120 (level 127) and 180 (level 191) respectively.

I printed this image on standard photocopy paper and then both scanned and photographed the resulting print.  The comparison below highlights the variation and loss of quality during reproduction.  
  • The printer wasn't able to reproduce the tonal range perfectly (though visually I can confirm the printer did a pretty good job).  
  • The scanner reproduced white correctly but the other tones were all below par, the black target being reduced to well below the 180 luminosity target of the original image.  Overall therefore the scan tended to overexpose the image.
  • The digital photo did better than the scanner but only with a fair degree of help in Camera Raw.
  • It was not possible to reproduce a perfect white in the photograph without drastically losing tonal range in the other targets.  The lack of natural contrast in the photograph was down to the ambient light when the photograph was taken.
Basically, the conclusion is that replicating and maintaining tonal range and contrast during reproduction is a major challenge, requiring ideal lighting, ideal exposure control and careful calibration of imaging equipment.

Tonal relevance for bird identification
We know there is a lot of intra-specific variation in relation to plumage tone, due to factors ranging from physiology and metabolism to genetics. Then, plumage tone is never static.  Wear and fading due to light and the other elements is an ongoing process.  If that wasn't enough, bright light and dark shadows obviously change the apparent tones of plumage and bareparts.  So, experienced observers are naturally wary of placing too much emphasis on tone in the field and indeed from photos.

On the other hand, intra-specific clines frequently follow a tonal gradient so it can help to try and maximise accurate tonal reproduction to try and find an individual bird's position on that gradient.  Gull enthusiasts and those trying to get to grips with very similar species (eg. Chiffchaffs in Europe) will also probably find that accurate or standard tonal references are really useful.

So what tools do we have at our disposal to try and bring this complex area under some degree of control.

Step 1  Use of Greyscale
Firstly, in the initial stages of an investigation at least, it helps to switch to grey scale.  Colour can overwhelm our visual system and make it difficult to distinguish levels.  It is far easier to appreciate level differences when working in monochrome.  Working in monochrome eliminates Hue and Saturation from the image equation, leaving just Luminosity.  Luminosity levels are all we have to form an image - i.e. this is the 'birds and light equation' expressed at it's purest.

Step 2  Use of Image Lighting Tools
Adobe Photoshop uses three different sets of lighting tools and is a good, flexible software package for image editing and analysis.  Elements is cheaper to buy than some of the other Adobe packages and is ideal for our needs.  Each of the lighting tools manipulates image tonal data, or levels in various different ways.

The function of each of these tools is outlined below.  Obviously they are intended mainly for photographers who want to make the most of their images.  For our purposes, we are particularly interested in how they can be used to enhance identification features in images.  The test image is the grid shown above, consisting of each of the 256 levels in sRGB.  Beside that is a histogram.  An image histogram is just a graphical representations of levels showing the number of pixels at each level.  The original image shows a more or less flat histogram as there are a more or less equal number of pixels at each level.  This is useful as it allows us to understand the actual impact of each tool on tonal range. 

The Brightness Tool
This tool most closely replicates the effects of increasing or decreasing camera exposure time.  It affects the whole tonal range.  As it pushes all pixels towards the left or right edges of the histogram they begin to pile up towards the edge.  Interestingly, it appears from this experiment that the algorithmic logic applied to brightening an image differs to that used for darkening an image.  Fully lightening the image has stacked the pixels more towards extreme white and the graph is steeper.  Whereas fully darkening the image isn't quite as extreme.

The Contrast Tool
This tool most closely matches the effects of low or high dynamic range in ambient lighting terms (eg. a foggy day manifests as low dynamic range while a bright sunny day results in high dynamic range - often in fact, well beyond the range of the camera sensor). Reducing image contrast results in a slight piling up of pixels in the middle of the histogram whereas an increase in contrast forces the pixels towards both extremes of the histogram.

Highlights Tool
As the name suggests, this tool focuses mainly on the right hand side of the histogram.  Darkening of highlights has the effect of pushing all the highlights pixels towards the centre of the graph but it doesn't tend to influence the left hand side to any great extent.  This tool is useful for peering into highlight detail without disturbing the shadows too much.

Shadows Tool
This is the exact opposite to the highlights tool, allowing peering into shadows without significantly disturbing highlights.  

Midtone Contrast Tool
This tool works much like the contrast tool but it excludes pixels at the extreme ends of the tonal range.  This too could be a very useful tool for exposing detail hiding in the shadows or highlights of images.

Black Point Tool
Levels can be a useful broad stroke tool for analysing images.  The Black Point slider or dropper is used to set the black tonal level.  Once set, everything to the left of that point is discarded, so it needs to be used carefully.

White Point Tool 
As with the black point tool this must be used carefully.  This tool in particular can actually be useful for another purpose, other than to simply define pure white in an image.  By adjusting the white point slider back and forth it can sometimes be used to study the direction and intensity of illumination within a photograph.

Midtone Level Tool
This is similar to the brightness tool but it mainly influences the midtones range and therefore tends to produce more useful and less drastic changes.  It has an interesting impact on the histogram and seems to be programmed to have more or less the opposite effect to the brightness tool.  See a comparison of these histograms below.

It is also useful to compare contrast and midtone contrast tools here.

Here is a summary of Adobe Elements Lighting tools highlighting, within the histogram, the primary areas of influence of each tool.

In summary, Lighting Tools are a great little toolkit for forensic analysis of digital images.  With a bit of practice it should be possible to use the finer tools (Highlights, Shadows and Levels) to extract and present specific details without too drastic a change to the overall image.

No comments:

Post a Comment