An image with too few samples looks blocky because the pels are too big. A television picture or camera image is usually stored as 512x512 pels, which is often more than enough for such sources. High resolution CCD cameras can produce 6000x4000 pels by slowly scanning a single line sensor or even moving an array sensor (see MARC). A 35mm slide scanner usually provides around 6000x4000 pels, which is more than enough for this film (50-100 line pairs per mm). If insufficient resolution is used, then fine detail is lost and may even cause spurious patterns or aliasing. Classical examples of this are the bands produced by overlapping net curtains due to one pattern sampling another by occlusion. The figure below illustrates this in one dimension. Wagon wheels which turn the wrong way on films are aliasing in time, due to the film frames being taken too slowly and catching the wheel at various stages of rotation. Television uses 25 frames per second (USA/NTSC is 60!), which is just unnoticeable by the eye (but try looking at a TV with your peripheral vision, which is more sensitive to motion). Modern displays refresh the screen at more than 70 frames per second, so other people's displays don't flicker in the corner of your eye.

Sampling and aliasing

Very often an image has a greater resolution than necessary and needs "shrinking". Some scanners use a high resolution sensor but to take lower resolution images, skip some CCD values. If this is not carried out carefully, the images will contain spurious patterns, especially in fine detail and sharp borders which will acquire ripples. This is called aliasing and occurs in time as well as space: backward spinning wheels in films are due to the frame rate of the camera being too slow to capture the fast wheel.

Illustration of aliasing

Samples should be taken at twice the maximum frequency the data contains, to give at least two samples for a cycle (this is called Nyquist sampling). So to record an image of an object which has 0.1mm features, the samples should represent at most 0.05mm of object. In practice more will be needed to clearly see the feature and compensate for blurring etc. When a high resolution image is made, some way of viewing the whole image is needed due to limitations in displays (4000x4000 is the best and most expensive monitor you can buy!). This involves simple sampling of the image but taking one in six pels for example is not good enough, as it can cause distortions known as aliasing where the high frequencies cause errors. Ideally all frequencies below half the sampling frequency should be removed first, so that the sampling becomes "Nyquist". This can be simplified to filtering with a suitable low-pass filter such as a block average, of the appropriate size. To shrink a picture by 2:1, 2x2 blocks can be averaged by filtering the whole image and the result sampled every two pels. Alternatively 2x2 blocks can be averaged every two pels, which is quicker. This is not the ideal filter but is generally used for simplicity. Low pass filtering has to be carried out carefully because if the filter is too good and cuts out frequencies completely at one frequency (a "brick wall" filter!) some other frequency components can suddenly appear as ripples or ringing. In practice a smoother cut-off point is use to prevent this. Another danger is that the image is blurred too much and the smaller image appears blurred as well.

To carry out slight image size increases interpolation is used to estimate the new pels and "move" the sampling points. The result is an image which may only contain a few of the original pel values, the rest are estimates, so the interpolation method is critical. Simply taking the nearest neighbour value to the point required is very quick but gives poor quality. A technique called bilinear interpolation using a 2x2 area is good for fairly smooth images and errors are difficult to see. Bicubic interpolation using 4x4 blocks is more complex and hence slower but yields good results. Interpolation is also required to rotate or geometrically correct an image. Programs such as Adobe Photoshop have all three techniques available so the simplest can be used first for speed and checking, then bicubic can be used for the final image.

Resampling an image can introduce artifacts and blurring so it must be done carefully. If an image is repeatedly rotated or resized it will become progressively distorted. Once an image is shrunk it can not be expanded to its original state without blurring. For this reason it is important to retain original scans of images, preferably of higher resolution than needed.