When down scaling below a certain threshold, such as more than twice for all bi-sampling algorithms, the algorithms will sample non-adjacent pixels, which results in both losing data, and causes rough results. One weakness of bilinear, bicubic and related algorithms is that they sample a specific number of pixels. Bicubic interpolation can be regarded as a computationally efficient approximation to Lanczos resampling. Lanczos resampling, an approximation to the sinc method, yields better results. In practice, the assumptions behind sinc resampling are not completely met by real-world digital images. Sinc resampling in theory provides the best possible reconstruction for a perfectly bandlimited signal. Bicubic interpolation yields substantially better results, with an increase in computational cost. Although this is desirable for continuous-tone images, this algorithm reduces contrast (sharp edges) in a way that may be undesirable for line art. Bilinear and bicubic algorithms īilinear interpolation works by interpolating pixel color values, introducing a continuous transition into the output even where the original material has discrete transitions.
Rounding this way produces fewer artifacts and is faster to calculate. One common implementation is to always round towards zero. 'Nearest' in nearest-neighbor doesn't have to be the mathematical nearest. This can preserve sharp details in pixel art, but also introduce jaggedness in previously smooth images. One of the simpler ways of increasing image size is nearest-neighbor interpolation, replacing every pixel with the nearest pixel in the output for upscaling this means multiple pixels of the same color will be present. See also: Comparison gallery of image scaling algorithmsĪn image size can be changed in several ways. From the standpoint of digital signal processing, the scaling of raster graphics is a two-dimensional example of sample-rate conversion, the conversion of a discrete signal from a sampling rate (in this case the local sampling rate) to another. In the case of decreasing the pixel number (scaling down) this usually results in a visible quality loss. When scaling a raster graphics image, a new image with a higher or lower number of pixels must be generated. When scaling a vector graphic image, the graphic primitives that make up the image can be scaled using geometric transformations, with no loss of image quality. In video technology, the magnification of digital material is known as upscaling or resolution enhancement. In computer graphics and digital imaging, image scaling refers to the resizing of a digital image. Original Image (far left), Nearest Neighbour (second to furthest left), Bilinear (left from center), Bicubic (center), Bicubic Smoother (right from center), Bicubic Sharper (second to furthest right), Bicubic Automatic (far right).