HOME

TheInfoList



OR:

In
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great deal ...
and
digital imaging Digital imaging or digital image acquisition is the creation of a digital representation of the visual characteristics of an object, such as a physical scene or the interior structure of an object. The term is often assumed to imply or include ...
, image scaling refers to the resizing of a digital image. In video technology, the magnification of digital material is known as upscaling or resolution enhancement. 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 Image quality can refer to the level of accuracy with which different imaging systems capture, process, store, compress, transmit and display the signals that form an image. Another definition refers to image quality as "the weighted combination of ...
. When scaling a
raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
image, a new image with a higher or lower number of pixels must be generated. In the case of decreasing the pixel number (scaling down) this usually results in a visible quality loss. From the standpoint of
digital signal processing Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner ar ...
, 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.


Mathematical

Image scaling can be interpreted as a form of image resampling or image reconstruction from the view of the Nyquist sampling theorem. According to the theorem, downsampling to a smaller image from a higher-resolution original can only be carried out after applying a suitable 2D anti-aliasing filter to prevent aliasing artifacts. The image is reduced to the information that can be carried by the smaller image. In the case of up sampling, a reconstruction filter takes the place of the anti-aliasing filter. File:160 by 160 thumbnail of 'Green Sea Shell'.png , Original 160x160px image File:160 by 160 thumbnail of 'Green Sea Shell' - 0. in fourier domain.png , Original image in spatial-frequency domain File:160 by 160 thumbnail of 'Green Sea Shell' - 1. fourier filtered for downsampling to 40 x 40.png , 2D
low-pass filter A low-pass filter is a filter that passes signals with a frequency lower than a selected cutoff frequency and attenuates signals with frequencies higher than the cutoff frequency. The exact frequency response of the filter depends on the filt ...
ed, but still at 160x160px File:160 by 160 thumbnail of 'Green Sea Shell' - 1.1. fourier filtered image for downsampling to 40 x 40 in fourier domain.png , Filtered image in spatial-frequency domain
File:160 by 160 thumbnail of 'Green Sea Shell' - 2. downsampling to 40 x 40 (nearest neighour).png , low-pass filtered 160x160px image 4× downsampled to 40x40px File:160 by 160 thumbnail of 'Green Sea Shell' - 3. fourier reconstruction from 40 x 40.png , 4× Fourier upsampling of 40x40px downsampled image to 160x160px (correct reconstruction) File:160 by 160 thumbnail of 'Green Sea Shell' - 4. fourier reconstruction from 40 x 40 (aliasing ).png , 4× Fourier upsampling of 40x40px downsampled image to 160x160px (with aliasing) A more sophisticated approach to upscaling treats the problem as an
inverse problem An inverse problem in science is the process of calculating from a set of observations the causal factors that produced them: for example, calculating an image in X-ray computed tomography, source reconstruction in acoustics, or calculating th ...
, solving the question of generating a plausible image, which, when scaled down, would look like the input image. A variety of techniques have been applied for this, including optimization techniques with regularization terms and the use of
machine learning Machine learning (ML) is a field of inquiry devoted to understanding and building methods that 'learn', that is, methods that leverage data to improve performance on some set of tasks. It is seen as a part of artificial intelligence. Machine ...
from examples.


Algorithms

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 in pixel art, but also introduce jaggedness in previously smooth images. 'Nearest' in nearest-neighbor doesn't have to be the mathematical nearest. One common implementation is to always round towards zero. Rounding this way produces fewer artifacts and is faster to calculate.


Bilinear and bicubic algorithms

Bilinear interpolation In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., ''x'' and ''y'') using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be ge ...
works by
interpolating In the mathematics, mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points. In engineering and science, one ...
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 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. 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 are mipmaps. A mipmap is a prescaled set of downscale copies. When downscaling the nearest larger mipmap is used as the origin, to ensure no scaling below the useful threshold of bilinear scaling is used. This algorithm is fast, and easy to optimize. It is standard in many frameworks such as
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve ha ...
. The cost is using more image memory, exactly one third more in the standard implementation.


Fourier-transform methods

Simple interpolation based on
Fourier transform A Fourier transform (FT) is a mathematical transform that decomposes functions into frequency components, which are represented by the output of the transform as a function of frequency. Most commonly functions of time or space are transformed, ...
pads the
frequency domain In physics, electronics, control systems engineering, and statistics, the frequency domain refers to the analysis of mathematical functions or signals with respect to frequency, rather than time. Put simply, a time-domain graph shows how a ...
with zero components (a smooth window-based approach would reduce the ringing). Besides the good conservation (or recovery) of details, notable is the ringing and the circular bleeding of content from the left border to 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 Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration. ...
(ICBI), and Directional Cubic Convolution Interpolation (DCCI). A 2013 analysis found that DCCI had the best scores in PSNR and SSIM 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 In image processing, hqx ("high quality scale") is one of the pixel art scaling algorithms developed by Maxim Stepin, used in emulators such as Nestopia, FCEUX, higan, Snes9x, ZSNES and many more. There are three hqx filters defined: hq2x, hq ...
or other pixel-art scaling algorithms. These produce sharp edges and maintain high level of detail.


Vectorization

Vector extraction, or vectorization, offer another approach. 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, and
Inkscape Inkscape is a free and open-source vector graphics editor used to create vector images, primarily in Scalable Vector Graphics (SVG) format. Other formats can be imported and exported. Inkscape can render primitive vector shapes (e.g. re ...
.
Scalable Vector Graphics Scalable Vector Graphics (SVG) is an XML-based vector image format for defining two-dimensional graphics, having support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium sin ...
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 Machine learning (ML) is a field of inquiry devoted to understanding and building methods that 'learn', that is, methods that leverage data to improve performance on some set of tasks. It is seen as a part of artificial intelligence. Machine ...
for more detailed images such as photographs and complex artwork. Programs that use this method include waifu2x, Imglarger and Neural Enhance.


Applications


General

Image scaling is used in, among other applications,
web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
s, image editors, image and file viewers, software magnifiers, digital zoom, the process of generating thumbnail images and when outputting images through screens or printers.


Video

This application is the magnification of images for home theaters for HDTV-ready output devices from PAL-Resolution content, for example from a DVD player. Upscaling is performed in real time, and the output signal is not saved.


Pixel-art scaling

As pixel-art graphics are usually low-resolution, they rely on careful placing of individual pixels, often with a limited palette of colors. This results in graphics that rely on stylized visual cues to define complex shapes with little resolution, down to individual pixels. This makes scaling of pixel art a particularly difficult problem. Specialized algorithms were developed to handle pixel-art graphics, as the traditional scaling algorithms do not take perceptual cues into account. Since a typical application is to improve the appearance of fourth-generation and earlier
video game Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device to gener ...
s on arcade and
console emulator A video game console emulator is a type of emulator that allows a computing device to emulate a video game console's hardware and play its games on the emulating platform. More often than not, emulators carry additional features that surpass ...
s, many are designed to run in real time for small input images at 60 frames per second. On fast hardware, these algorithms are suitable for gaming and other real-time image processing. These algorithms provide sharp, crisp graphics, while minimizing blur. Scaling art algorithms have been implemented in a wide range of emulators such as HqMAME and DOSBox, as well as 2D
game engine A game engine is a software framework primarily designed for the development of video games and generally includes relevant libraries and support programs. The "engine" terminology is similar to the term " software engine" used in the softwar ...
s and game engine recreations such as ScummVM. They gained recognition with gamers, for whom these technologies encouraged a revival of 1980s and 1990s gaming experiences. Such filters are currently used in commercial emulators on
Xbox Live The Xbox network, formerly and still sometimes branded as Xbox Live, is an online multiplayer gaming and digital media delivery service created and operated by Microsoft. It was first made available to the Xbox system on November 15, 2002. An u ...
,
Virtual Console A virtual console (VC) – also known as a virtual terminal (VT) – is a conceptual combination of the keyboard and display for a computer user interface. It is a feature of some Unix-like operating systems such as Linux, BSD, illumos, Un ...
, and
PSN PlayStation Network (PSN) is a digital media entertainment service provided by Sony Interactive Entertainment. Launched in November 2006, PSN was originally conceived for the PlayStation video game consoles, but soon extended to encompass smartp ...
to allow classic low-resolution games to be more visually appealing on modern HD displays. Recently released games that incorporate these filters include '' Sonic's Ultimate Genesis Collection'', '' Castlevania: The Dracula X Chronicles'', '' Castlevania: Symphony of the Night'', and ''
Akumajō Dracula X Chi no Rondo ''Castlevania: Rondo of Blood'', originally released in Japan as is a platform-adventure video game developed by Konami for the PC Engine's Super CD-ROM² System directed by Toru Hagihara. Part of the ''Castlevania'' series, protagonist Richter ...
''.


Real-time scaling

A number of companies have developed techniques to upscale video frames in real-time, such as when they are drawn on screen in a video game.
Nvidia Nvidia CorporationOfficially written as NVIDIA and stylized in its logo as VIDIA with the lowercase "n" the same height as the uppercase "VIDIA"; formerly stylized as VIDIA with a large italicized lowercase "n" on products from the mid 1990s to ...
's deep learning super sampling (DLSS) uses deep learning to upsample lower- resolution images to a higher resolution for display on higher-resolution computer monitors. AMD's FidelityFX Super Resolution 1.0 (FSR) does not employ machine learning, instead using traditional hand-written algorithms to achieve spatial upscaling on traditional shading units. FSR 2.0 utilises temporal upscaling, again with a hand-tuned algorithm. FSR standardized presets are not enforced, and some titles such as ''
Dota 2 ''Dota 2'' is a 2013 multiplayer online battle arena (MOBA) video game by Valve. The game is a sequel to '' Defense of the Ancients'' (''DotA''), a community-created mod for Blizzard Entertainment's '' Warcraft III: Reign of Chaos.'' ''Dota ...
'' offer resolution sliders. Other technologies include
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the devel ...
XeSS and Nvidia Image Scaler (NIS).


See also

* Bicubic interpolation *
Bilinear interpolation In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., ''x'' and ''y'') using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be ge ...
* Lanczos resampling *
Spline interpolation In the mathematical field of numerical analysis, spline interpolation is a form of interpolation where the interpolant is a special type of piecewise polynomial called a spline. That is, instead of fitting a single, high-degree polynomial to all ...
* Seam carving *
Image reconstruction Iterative reconstruction refers to iterative algorithms used to reconstruct 2D and 3D images in certain imaging techniques. For example, in computed tomography an image must be reconstructed from projections of an object. Here, iterative reco ...
*
Video scaler A video scaler is a system which converts video signals from one display resolution to another; typically, scalers are used to convert a signal from a lower resolution (such as 480p standard definition) to a higher resolution (such as 1080i hi ...


References

{{Video processing Image processing Articles containing video clips