An image size can be changed in several ways.
Nearest-neighbor interpolation 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. This can preserve sharp details but also introduce
jaggedness in previously smooth images. 'Nearest' in nearest-neighbor does not have to be the mathematical nearest. One common implementation is to always round toward zero. Rounding this way produces fewer artifacts and is faster to calculate. This algorithm is often preferred for images which have little to no smooth edges. A common application of this can be found in
pixel art.
Bilinear and bicubic interpolation Bilinear interpolation works by
interpolating pixel color values, introducing a continuous transition into the output even where the original material has discrete transitions. Although this is desirable for continuous-tone images, this algorithm reduces
contrast (sharp edges) in a way that may be undesirable for line art.
Bicubic interpolation yields substantially better results, with an increase in computational cost.
Sinc and Lanczos resampling Sinc resampling, in theory, provides the best possible reconstruction for a perfectly bandlimited signal. In practice, the assumptions behind sinc resampling are not completely met by real-world digital images.
Lanczos resampling, an approximation to the sinc method, yields better results. Bicubic interpolation can be regarded as a computationally efficient approximation to Lanczos resampling.
Box sampling One weakness of bilinear, bicubic, and related algorithms is that they sample a specific number of pixels. When downscaling 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 rough results. The trivial solution to this issue is box sampling, which is to consider the target pixel a box on the original image and sample all pixels inside the box. This ensures that all input pixels contribute to the output. The major weakness of this algorithm is that it is hard to optimize.
Mipmap Another solution to the downscale problem of bi-sampling scaling is
mipmaps. A mipmap is a prescaled set of downscaled copies. When downscaling, the nearest larger mipmap is used as the origin to ensure no scaling below the useful threshold of bilinear scaling. This algorithm is fast and easy to optimize. It is standard in many frameworks, such as
OpenGL. The cost is using more image memory, exactly one-third more in the standard implementation.
Fourier-transform methods Simple interpolation based on the
Fourier transform pads the
frequency domain with zero components (a smooth window-based approach would reduce the
ringing). Besides the good conservation (or recovery) of details, notable are the ringing and the circular bleeding of content from the left border to the right border (and the other way around).
Edge-directed interpolation Edge-directed interpolation algorithms aim to preserve edges in the image after scaling, unlike other algorithms, which can introduce staircase artifacts. Examples of algorithms for this task include New Edge-Directed Interpolation (NEDI), Edge-Guided Image Interpolation (EGGI),
Iterative Curvature-Based Interpolation (ICBI), and
Directional Cubic Convolution Interpolation (DCCI). A 2013 analysis found that DCCI had the best scores in
peak signal-to-noise ratio and
structural similarity on a series of test images.
hqx For magnifying computer graphics with low resolution and/or few colors (usually from 2 to 256 colors), better results can be achieved by
hqx or other
pixel-art scaling algorithms. These produce sharp edges and maintain a high level of detail.
Vectorization Vector extraction, or
vectorization, offers another approach. Vectorization first creates a resolution-independent vector representation of the graphic to be scaled. The resulting SVG vector file can then be exported and rendered at any required resolution without quality loss, serving directly as production-ready artwork for scalable display & printing. This technique is used by
Adobe Illustrator, Live Trace, and
Inkscape.
Scalable Vector Graphics are well suited to simple geometric images, while photographs do not fare well with vectorization due to their complexity.
Deep convolutional neural networks This method uses
machine learning for more detailed images, such as photographs and complex artwork. Programs that use this method include
waifu2x, Imglarger and Neural Enhance. Demonstration of conventional vs. waifu2x upscaling with noise reduction, using a detail of
Phosphorus and Hesperus by
Evelyn De Morgan. [Click image for full size] File:Evelyn de Morgan - Phosphorus and Hesperus, (1881) detail.png|Original image File:Evelyn de Morgan - Phosphorus and Hesperus, (1881) detail - upscaled 200% using Paint Shop Pro.png|Image upscaled 200% using
PaintShop Pro File:Evelyn de Morgan - Phosphorus and Hesperus, (1881) detail - upscaled 200% using Waifu2x in Photo mode with Medium noise reduction.png|Image upscaled 200% using
waifu2x in Photo mode with Medium noise reduction File:Evelyn de Morgan - Phosphorus and Hesperus, (1881) detail output.png|Image upscaled 400% using Topaz A.I. Gigapixel with Low noise reduction File:Evelyn de Morgan - Phosphorus and Hesperus, (1881) RealSR.png|Image upscaled 400% using RealSR DF2K-JPEG AI-driven upscaling software allows detail and sharpness to be added to historical photographs, where it is not present in the original. File:John Howard Lindauer portrait.jpg|Low-quality 270×368 pixel photograph of
John Howard Lindauer, scanned from a State Legislature directory File:John Howard Lindauer 1983 (upscaled whitebackground enhanced).jpg|The same image enhanced and upscaled to 2160×2944 pixels The availability of AI upscaling tools has led to confusion where a person believes that the upscaled version of a blurry image is genuinely showing them the subject of the original photograph. In 2025 a user of the social media site
X posted an AI-upscaled version of a low resolution photo of
Donald Trump that they had zoomed in on, and asked if anyone could "explain what the hell is happening to his forehead". Experts noted that the image had been distorted by the upscaling process, and that such tools "inevitably have to invent, or at least recreate, details that were or were not there". == Applications ==