# How does a computer upscale 1024x768 resolution to 1920x1080?

Without there being black bars I mean. 1080 isn't any multiple of 768 so is there some sort of data loss?

• There are scaling algorithms like bicubic scaling which use splines to approximate the color of pixels when scaled to any size. – EvilTak Jan 3 '16 at 13:09
• @EvilTak, can you expand your comment into an small answer? – glampert Jan 5 '16 at 16:37
• @glampert did that. Do you want me to remove my comment? – EvilTak Jan 6 '16 at 8:00
• @EvilTak, I think you can leave it. Nice answer btw, thanks! – glampert Jan 6 '16 at 14:27

In essence a image is a group of point samples (read A pixel is not a little square3). When you transform or scale the image you need to resample it. So what you do, theoretically, is take the point samples and convert them into a continuous function. Then you sample that continuous function and reconstruct a signal. So, there are two or three different phases here.

1. Converting the samples to a continuous function, (function reconstruction).
2. (Transforming)
3. Re-sampling the signal

Note that none of these steps have a fixed form. In practice, when optimized, it's impossible to tell that there are steps. The transformation does not really have to be simple it could be mapping the shape into a spiral etc.

Image 1: A 1-D signal reconstructed by different filters.

In practice, quite a bit of lore is known about signal reconstruction in the signal processing field. Designing these filters and choosing the right one is a art form on its own. But, in essence, the choice of filter is a tradeoff between blurring and ringing. Of course the algorithm also has other qualities such as how many instructions it takes to implement and how fast and how much memory it needs etc. Which can be very important in realtime or embedded applications.

Image 2: Overview of entire process.

There are numerous upscaling and downscaling algorithms available to scale images from any resolution to any other arbitrary resolution. Each algorithm typically involves a trade-off between efficiency, smoothness and sharpness, with varying degrees of each trade-off for different algorithms.

Check out this Wikipedia article for such algorithms and examples of such algorithms.

The most popularly known (and used) algorithm is the Bicubic interpolation algorithm. It interpolates between 2D points on a rectangular grid. Using Cubic Splines (or Cubic Interpolation), It first interpolates on one dimension (finds the interpolated row/column), then interpolates the interpolated row/column in the other dimension.

Bilinear interpolation is similar to Bicubic interpolation, except the former interpolates using a linear function and can interpolate only between two values and the latter uses a cubic function and can interpolate between four values.

The simple function for Bicubic interpolation is as follows:

f(f(p00, p01, p02, p03, y),
f(p10, p11, p12, p13, y),
f(p20, p21, p22, p23, y),
f(p30, p31, p32, p33, y),
x)


where (x, y) is the interpolated position and p[][] is the 2d array representing the 4 * 4 grid.