Pixel art scaling algorithms
From Wikipedia, the free encyclopedia
Pixel art scaling algorithms are image scaling algorithms specifically designed to enlarge low-resolution pixel and line art that contains thin lines, solid areas of colour rather than gradient fills or shading, and has not been anti-aliased.
The standard scaling algorithms are bilinear and bicubic interpolation. Since they work by interpolating pixel colour values, and usually set each pixel to a value interpolated between four input pixel values, they introduce some blur into the output. Although this is acceptable for continuous-tone images, it destroys sharp edges and is often seen as ruining the appearance of line art. Nearest neighbour interpolation preserves these sharp edges, but it makes diagonal lines and curves look blocky. Thus, the ideal algorithm for enlarging line art would be one that would interpolate areas of continuous tone, preserve the sharpness of orthogonal lines and smooth (ideally with anti-aliasing) diagonal lines and curves. Several attempts have been made to accomplish this.
Since a typical application of this technology is improving the appearance of fourth-generation and earlier video games on arcade and console emulators, many are designed to run in real time for sufficiently small input images. Many work only on specific scale factors.
Contents |
[edit] Eagle
| Please help improve this section by expanding it. Further information might be found on the talk page or at requests for expansion. |
An early algorithm was the "Eagle" engine in the RetroFX library.
[edit] 2xSaI
2xSaI, short for 2x Scale and Interpolation engine, is a digital image processing algorithm for computer graphics. It doubles the images both horizontally and vertically, resulting in a new image with four times as many pixels as the original one. The additional pixels are generated by detecting patterns such as lines and edges and interpolating additional pixels on that basis using techniques such as anti-aliasing and Wu lines.
The 2xSaI algorithm was inspired by Eagle. It was designed by Derek Liauw Kie Fa, also known as Kreed, primarily for use in console and computer emulators, and it has remained fairly popular in this niche. Many of the most popular emulators, including ZSNES and VisualBoyAdvance, offer this scaling algorithm as a feature.
Since Kreed released the source code under the GNU General Public License, it is freely available to anyone wishing to utilize it in a project released under that license. Developers wishing to use it in a non-GPL project would be required to rewrite the algorithm without using any of Kreed's existing code.
[edit] Super 2xSaI and Super Eagle
Several slightly different versions of the scaling algorithm are available, and these are often referred to as "Super 2xSaI", "2xSaI", and "Super Eagle".
[edit] hqnx family
Maxim Stepin's hq2x, hq3x and hq4x are for scale factors of 2:1, 3:1 and 4:1 respectively. Each works by comparing the colour value of each pixel to those of its eight immediate neighbours, marking the neighbours as close or distant, and using a pregenerated lookup table to find the proper proportion of input pixels' values for each of the 4, 9 or 16 corresponding output pixels. The hq3x family will perfectly smooth any diagonal line whose slope is ±1:2, ±1:1 or ±2:1 and which is not anti-aliased in the input; one with any other slope will alternate between two slopes in the output. It will also smooth very tight curves. Unlike 2xSaI, it anti-aliases the output.[1]
Image enlarged in size by 3× with the nearest neighbor interpolation algorithm:
Image enlarged in size by 3× with hq3x algorithm:
hqnx was initially created for the Super Nintendo emulator ZSNES.
[edit] Others
Several similar interpolating graphics engines exist today. These include the open source family of Scale2x, Scale3x and Scale4x technologies (also referred to as AdvMame2x, AdvMame3x or AdvMame4x) developed in 2001 for use in the AdvanceMAME emulator.
[edit] Applications to arcade and console emulators
On sufficiently fast hardware, these algorithms allow resizing suitable for real-time applications such as games. These highly optimized algorithms provide sharp, crisp graphics while minimizing blur. Scaling art algorithms have been implemented in a wide range of emulators, 2D game engines and game engine recreations, for example in AdvanceMAME, DOSBox and ScummVM. They have gained wide recognition with gamers, with whom these technologies have encouraged a revival of the gaming experiences of the '80s and '90s (see abandonware).
[edit] References
- ^ Stepin, Maxim. hq3x Magnification Filter. Retrieved on 2007-07-03.




