Free help and advice to the UK Further and Higher Education community

Helpdesk

Resampling Raster Images

Last updated: 28 January 2009
Published in: Digitising analogue media | Creating new digital media
Tags: digitisation | image editing | photoshop | resolution | storage

Comment icon Comments (0)

Summary

This document uses images to illustrate how different resampling methods will affect the appearance of the resized image. The most suitable method varies according to the type of image being resampled, this paper helps to guide the user to the appropriate resampling method for their images.

Introduction

Images are often captured at a high resolution, anticipating all potential uses for the picture: from high quality archival images through to low-resolution thumbnails. These raster images can be scaled down with care but scaling up should be avoided if at all possible. Vector images on the other hand can be scaled up or down with no loss of detail.

Original test image - a square shape divided into four equal parts. Top left corner is a black square with white circle in centre; top right is a green to blue gradient; bottom left is a black italic letter 'A' in a serif font against a red background; bottom right is divided diagonally into a grey area and a black area

Figure 1. Original image

Altering the size of a digital image is called resampling, interpolation or down-sampling. Most image optimisation programs offer a choice of resampling methods.  Resampling is a complex process, which basically involves creating an empty document with the new physical dimensions and then selecting how the colour information in the pixels from the original image will be remapped to pixels in the resized document. The three most commonly used resampling methods are nearest neighbour, bilinear and bicubic.

Nearest Neighbour

The most basic type of resampling is nearest neighbour. This method matches a pixel from the original image to the corresponding position in the resized document. The original colour and tone values are retained and no new averaged colours are created. If no pixel from the original matches the new position then its nearest neighbour is taken instead.

Resampled test image (nearest neighbour)  Magnified view of resampled test image (nearest neighbour)

Figure 2. Resampled image (nearest neighbour) with magnified version

Because no new colours are introduced to the image, edge detail remains sharp though the image will be more pixelated and ‘jaggies’ may be obvious.  The illustration on the left shows very obvious ‘jaggies’ on the diagonal line, text and circle and there is a little more pixelation in the green/blue gradient. While this is the crudest option overall, it does give the best results with horizontal and vertical lines. This method is best suited to simple flat colour graphics such as bar graphs.

Bilinear

Bilinear resampling is more sophisticated than the nearest neighbour method; it averages 4 neighbouring pixels to produce the new pixel colour values in the resampled image. The advantage of this method is that all of the original pixels contribute to the new pixel values. There are less ‘jaggie’ edges and the overall look is smoother than the nearest neighbour option.

This does however introduce new averaged colours not necessarily found in the original. Edge contrast in the original is also averaged and may appear blurred in the resized document.

Resampled test image (bilinear)  Magnified view of resampled test image (bilinear)

Figure 3. Resampled image (bilinear) with magnified version

Bilinear resampling also takes considerably longer to process than the nearest neighbour method. The illustration shows softer ‘jaggies’ on the diagonal line, text and circle than the image resampled with nearest neighbour method and the green/ blue gradient is slightly smoother but the vertical and horizontal edges are soft and new colours have been introduced.  This method is suited for resampling photographic images.

Bicubic

With this method the image is divided into squares of 4 pixels x 4 pixels, the behaviour of colour within each 16 pixel group is used to more accurately predict the appearance of the new resampled pixels.

Resampled test image (bicubic)  Magnified view of resampled test image (bicubic)

Figure 4. Resampled image (bicubic) with magnified version

This is the default resampling method used by the main optimisation programs as it normally produces the most pleasing results. It is also the slowest of the resampling methods. This method is used for photographic images.

Because the bicubic method introduces blurred edges to an image it is often followed by some un-sharp masking.

Last updated: 28 January 2009
Published in: Digitising analogue media | Creating new digital media
Tags: digitisation | image editing | photoshop | resolution | storage

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Comments (0)

Post your comment

How was this document useful to you? Do you have any questions?

Name

Email (required, but will not be shown)

URL (optional)


Please note: All comments are reviewed by a moderator for approval