A digital image consists basically of a grid of pixels. The numbers of rows and columns in the grid are a major factor in determining the resolution of the image, or the amount of detail recorded. A six-megapixel camera is therefore one whose sensor is basically capable of recording six million different samples of colour and brightness. Such a sensor might typically have 2,000 rows and 3,000 columns of pixels (2,000 x 3,000 = 6 million).
When an image captured on a sensor of this resolution is displayed on a computer monitor, there are far too many pixels. Most computer monitors are capable of displaying either 96 or 72 pixels per inch (ppi) both vertically and horizontally. If a 96ppi monitor has, for example dimensions of 15" x 12", it is capable of displaying simultaneously only 15 x 96 pixels across its width and 12 x 96 pixels vertically. This is a total of only (15 x 96) x (12 x 96) = 1,658,880 pixels. Interpolation is basically the process of fitting the six million pixels of the image on to the 1.658 million pixels of the monitor.
Reduction of the number of pixels in an image is rather
simpler than achieving an increase although the basic process is the same in
both cases. In a case where the number of pixels is exactly double what is
required in both the vertical and horizontal planes, it is a simple matter to
remove every other pixel. Similarly, where the number of required pixels in an
image is only half the required amount, each pixel can be duplicated. However
practical applications are rarely so simple.
The problem is easily seen in the two images. The left-hand image is 30 pixels in width and 26 pixels in height. To display it on an imaginary monitor 17 pixels in width and 15 pixels in height it is necessary to recreate every pixel to preserve in the best way possible the detail of the original image.
There are a number of algorithms used to make such conversions, but three are most commonly used. These are known as "nearest neighbour", "bilinear" and bicubic interpolation.
The
nearest neighbour technique is the simplest and easiest to understand. It merely
duplicates the appropriate number of adjacent pixels and copies them in to the
image. This works well in graphical applications where it is desirable to
preserve clean edges to lines and other objects. However in areas of smooth
tonal change the results tend to be unsatisfactory. Bilinear interpolation
averages the values of the four pixels above, below, and to either side of each
pixel in an image. In the diagram the four grey pixels would be considered. This
gives much smoother results than the nearest neighbour technique. Bicubic
interpolation takes into account all eight neighbouring pixels for each pixel in
an image and computes a weighted average to give the best possible result. In
the diagram the eight grey pixels would be incorporated into the calculations.
This technique is the most often used by photographers but also requires the
most computing power.