Image Scaling - Scaling Methods

Scaling Methods

An image size can be changed in several ways. Consider doubling the size of the following image:

One of the simpler ways of doubling its size is nearest-neighbor interpolation, replacing every pixel with four pixels of the same color:

The resulting image is larger than the original, and preserves all the original detail, but has undesirable jaggedness. The diagonal lines of the W, for example, now show the characteristic "stairway" shape.

Other scaling methods are better at preserving smooth contours in the image. For example, bilinear interpolation produces the following result:

Linear (or bilinear, in two dimensions) interpolation is typically better than the nearest-neighbor system for changing the size of an image, but causes some undesirable softening of details and can still be somewhat jagged. Better scaling methods include bicubic interpolation (example below) and Lanczos resampling.

For magnifying computer graphics with low resolution and/or few colors (usually from 2 to 256 colors) the best results will be achieved by hqx or other pixel art scaling algorithms. These produce sharp edges and maintain high level of detail. hq2x:

For scaling photos (and raster images with lots of colors) see also anti-aliasing algorithms called supersampling.

An entirely different approach is vector extraction or vectorization. Vectorization first creates a resolution independent vector representation of the graphic to be scaled. Then the resolution-independent version is rendered as a raster image at the desired resolution. This technique is used by Adobe Live Trace, inkscape, and several recent papers.

Read more about this topic:  Image Scaling

Famous quotes containing the word methods:

    If you want to know the taste of a pear, you must change the pear by eating it yourself.... If you want to know the theory and methods of revolution, you must take part in revolution. All genuine knowledge originates in direct experience.
    Mao Zedong (1893–1976)