ian sharpe :: personal web site

The theory behind PosiTweak

Every pixel in a scanned image has a value that determines its colour. In 24-bit (True Colour) images, each value can be subdivided into three components: red, green and blue. Every colour is mixed from different amounts of these three primaries. The individual component values can vary between 0 and 255:

Image showing how colours are mixed from red, green and blue primaries

If we examine every pixel in a picture, we can make a list of all the red components, all the greens and all the blues. Graphs may then be plotted, showing how many pixels share the same values:

Image showing R G B analysis histograms for an image

Ignore the diagonal lines. The distributions will change from picture to picture but, within the limitations of the technology, they crudely approximate the distribution in the original scene. The above was taken from a scan of a print.

Note the bias in the greens towards a large number of brighter pixels. Much of that comes from sunlit grass. The blue values have a big boost in the brighter end of the chart, resulting from the blue in the sky.

Colours are almost never pure in nature, being blended to form intermediate hues. Although there are few red objects in the picture, most of the colours have a red element, particularly the masonry. Grey is a near-equal mix of red, green and blue, and white is fully red, green and blue. The white of the clouds boosts the right-hand end of each chart, while the mid-grey of the stone causes a peak in the mid-strength reds. Even the sky blue has a proportion of red. The vertical scales are not the same for each graph.

Now look at the distributions in the same picture, but this time scanned from the negative and the colours inverted. The new values are laid over the previous ones for comparison:

Image showing changed histograms

In all cases the ranges have been compressed and shifted along the axis. However, red has been shifted most, followed by green. Blue has been shifted least and if anything has moved higher. The net result is to emphasise the blue component of each pixel, giving an overall blue cast.

To correct the colourisation, the red, green and blue channels must be stretched and moved to map on to the original distributions. This is a simple piece of arithmetic performed on each pixel – simple, that is, once the shift and scale factors are known.

That is done by locating pixels whose true values are known and comparing them with the actual values. About the only things we can be sure of are that pure black is red=0, green=0, blue=0, and pure white is R=255, G=255, B=255.

Clicking on the image in PosiTweak reads the colour values under the pointer. This allows you to determine the white and black points. Given these, PosiTweak can calculate the offsets and multiplication factors adjustments that, when applied to every pixel, will put the three histograms back where they should be.

However, there is a catch. When the values are stretched, gaps are left. Why? Well, take the number sequence 1, 2, 3, 4 and multiply it by two to get 2, 4, 6, 8. The original values had no gaps. The new ones do. 

In the context of pixel values, subtly different hues become more different. This increases the speckliness of the image. Information in the original scene has been lost in the compression of the histograms, and once lost it cannot be replaced.

Image showing red histogram

The effect can be reduced by top-quality equipment that extracts more information from the negative. This means using purpose-built transparency scanner and working at greater than 24-bit colour depth. With more subtlety of colour to begin with, and with less severe manipulation necessary, the end product is of better quality.

Above you can see the processed red channel histogram overlaying the one from the print. Although similar, they are clearly different even if we allow for slightly different vertical scales and imperfect offset and stretch factors.

When a photographic print is made, the process does not allow for an exact duplicate of the recorded colours. Photographic paper has its own limitations, not to mention the variables of the process itself. A negative contains more information than can be extracted on to a conventional print. This one reason why, even with the crude home-made adaptor, you will see some astonishingly fresh-looking pictures, plus a bit more of the scene that is normally cropped off.

<<BACK TO POSITWEAK INSTRUCTIONS

All iansharpe.com site content and software © Ian Sharpe September 2010. Nothing may be reproduced without permission. See the full copyright statement. Use of iansharpe.com programs, information and advertisers signifies acceptance of the disclaimer. A privacy statement may be read here.