Comparison gallery of image scaling algorithms

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

This gallery shows the results of numerous image scaling algorithms.

Scaling methods[edit]

An image size can be changed in several ways. Consider resizing a 160x160 pixel photo to the following 40x40 pixel thumbnail and then scaling the thumbnail to a 160x160 pixel image. Also consider doubling the size of the following image containing text.

Low-resolution images
Thumbnail Text
Thumbnail Image Original Image 40x40 pixel thumbnail
Comparison of scaling methods
Original photo Upscaled thumbnail Upscaled text Algorithm and description
160×160 thumbnail reference Nearest-neighbor interpolation Nearest-neighbor interpolation

Nearest-neighbor interpolation[edit]

One of the simpler ways of increasing the size, replacing every pixel with a number of pixels of the same color. The resulting image is larger than the original, and preserves all the original detail, but has (possibly undesirable) jaggedness. The diagonal lines of the "W", for example, now show the "stairway" shape characteristic of nearest-neighbor interpolation. Other scaling methods below are better at preserving smooth contours in the image.

160×160 thumbnail reference Bilinear interpolation Linear Interpolation

Bilinear interpolation[edit]

Linear (or bilinear, in two dimensions) interpolation is typically good for changing the size of an image, but causes some undesirable softening of details and can still be somewhat jagged.

160×160 thumbnail reference Bicubic Interpolation Cubic Interpolation

Bicubic interpolation[edit]

Better scaling methods include bicubic interpolation, Lanczos resampling and Mitchell-Netravali filters.

160×160 thumbnail reference Fourier-based interpolation Fourier-based Interpolation + saturation

Fourier-based interpolation[edit]

Simple Fourier based interpolation based on padding of the frequency domain with zero components (a smooth-window-based approach would reduce the ringing). Beside the good conservation of details, notable is the ringing and the circular bleeding of content from the left border to right border (and way around).

160×160 thumbnail reference 40 by 40 thumbnail of 'Green Sea Shell' (x4 DCCI).png Wiki dcci 2x.png

Edge-directed interpolation[edit]

Edge-directed interpolation algorithms aim to preserve edges in the image after scaling, unlike other algorithms which can produce staircase artifacts around diagonal lines or curves. Examples of algorithms for this task include New Edge-Directed Interpolation (NEDI),[1][2] Edge-Guided Image Interpolation (EGGI),[3] Iterative Curvature-Based Interpolation (ICBI),[4] and Directional Cubic Convolution Interpolation (DCCI).[5] A study found that DCCI had the best scores in PSNR and SSIM on a series of test images.[6]

160×160 thumbnail reference hq4x scaling hq2x scaling

Pixel art scaling algorithms[edit]

For magnifying computer graphics with low resolution and few colors (usually from 2 to 256 colors), better results will be achieved by pixel art scaling algorithms such as hqx. These produce sharp edges and maintain high level of detail.

160×160 thumbnail reference Vectorization to 48 colors (Inkscape) Vectorization

Image tracing[edit]

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 Illustrator Live Trace, Inkscape, and several recent papers.[7] Scalable Vector Graphics are well suited to simple geometric images, while photographs do not fare well with vectorization due to their complexity.

160×160 thumbnail reference EDSR waifu2x

Deep convolutional neural networks[edit]

Using machine learning, convincing details are generated as best guesses by learning common patterns from a training data set. The upscaled result is sometimes described as a hallucination because the information introduced may not correspond to the content of the source. Enhanced deep residual network (EDSR) methods have been developed by optimizing conventional residual neural network architecture.[8] Programs that use this method include waifu2x, Imglarger and Neural Enhance.

160×160 thumbnail reference ESRGAN

Deep convolutional neural networks using perceptual loss[edit]

Developed on the basis of the super-resolution generative adversarial network (SRGAN) method,[9] enhanced SRGAN (ESRGAN)[10] is an incremental tweaking of the same generative adversarial network basis. Both methods rely on a perceptual loss function[11] to evaluate training iterations.


  1. ^ "Edge-Directed Interpolation". Retrieved 19 February 2016.
  2. ^ Xin Li; Michael T. Orchard. "NEW EDGE DIRECTED INTERPOLATION" (PDF). 2000 IEEE International Conference on Image Processing: 311. Archived from the original (PDF) on 2016-02-14. Retrieved 2016-07-03.
  3. ^ Zhang, D.; Xiaolin Wu (2006). "An Edge-Guided Image Interpolation Algorithm via Directional Filtering and Data Fusion". IEEE Transactions on Image Processing. 15 (8): 2226–38. Bibcode:2006ITIP...15.2226Z. doi:10.1109/TIP.2006.877407. PMID 16900678. S2CID 9760560.
  4. ^ K.Sreedhar Reddy; Dr.K.Rama Linga Reddy (December 2013). "Enlargement of Image Based Upon Interpolation Techniques" (PDF). International Journal of Advanced Research in Computer and Communication Engineering. 2 (12): 4631.
  5. ^ Dengwen Zhou; Xiaoliu Shen. "Image Zooming Using Directional Cubic Convolution Interpolation". Retrieved 13 September 2015.
  6. ^ Shaode Yu; Rongmao Li; Rui Zhang; Mou An; Shibin Wu; Yaoqin Xie (2013). "Performance evaluation of edge-directed interpolation methods for noise-free images". arXiv:1303.6455 [cs.CV].
  7. ^ Johannes Kopf and Dani Lischinski (2011). "Depixelizing Pixel Art". ACM Transactions on Graphics. 30 (4): 99:1–99:8. doi:10.1145/2010324.1964994. Archived from the original on 2015-09-01. Retrieved 24 October 2012.
  8. ^ Lim, Bee; Son, Sanghyun; Kim, Heewon; Nah, Seungjun; Kyoung Mu Lee (2017). "Enhanced Deep Residual Networks for Single Image Super-Resolution". arXiv:1707.02921 [cs.CV].
  9. ^ "Generative Adversarial Network and Super Resolution GAN(SRGAN)". Retrieved 26 August 2020.
  10. ^ Wang, Xintao; Yu, Ke; Wu, Shixiang; Gu, Jinjin; Liu, Yihao; Dong, Chao; Chen Change Loy; Qiao, Yu; Tang, Xiaoou (2018). "ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks". arXiv:1809.00219 [cs.CV].
  11. ^ "Perceptual Loss Functions". Retrieved 26 August 2020.