Interpolation is a method in which new data can be mathematically produced using a set of previously known data. This can be employed when transforming digital images (pictures on a computer).
A blogger has touched on the subject already in a previous post named, “Resizing Digital Images Using Interpolation”. There, many different methods that are used when resizing images are discussed:
- Nearest Neighbor Approach - getting the nearest pixel
- Bilinear Interpolation - averages four closest pixels
- Bicubic Interpolation - uses bordering pixels and the pixels around the border
Apart from these methods, engineers have devised even more complicated algorithms to alter images. One of these techniques is trilinear interpolation. This method first continuously halves the original image so that from a 16×16 image, 8×8, 4×4, … images will be made until there is an image which is only 1 pixel in size. The two nearest-sized images will undergo bilinear interpolation (e.g. if you want to resize a 16×16 image into a 7×7 image, the 8×8 and 4×4 image will be chosen). A third linear interpolation will then be performed between the results of these two images to produce the final result. The diagram below illustrates this well:

Another technique used to resize images is Two-Pass Algorithms with Filters. This algorithm first resizes the image along one axis first before resizing the other axis. When each pixel is resized, its color is determined by a filter function, which is a specifically weighted sum of neighboring pixels. However, this technique differs from bilinear interpolation, as there are many different ways to weigh each surrounding pixel: the box filter considers all the cells to be of the same weight and the triangle filter has a sum that is linearly weighted. There are numerous other filters including the bell filter, the spline, and the Lancoz. The chosen filter function is then used to evaluate every pixel, producing the altered image.
Needless to say, there are countless other algorithms that utilize the power of interpolation to calculate a resized image. But with all of these to choose from, you might ask, “what is the point of having so many?” The answer is that different techniques serve different purposes. While the nearest neighbor approach obvious yields a resulting image that is of far poorer quality compared to trilinear interpolation, its algorithm ensures that computation time is very minimal. Different circumstances calls on different requirements in terms of quality; hence the multitude of interpolation techniques. Generally, the higher the quality of the altered image, the more time is needed for calculation.
The following four images below show how different algorithms affects the quality of altered images:

^original image

^nearest neighbor approach

^bilinear interpolation

^supersampling 4x
This last technique - supersampling - is not discussed in this blog, but if you are interested, you should really take a look here and here. I also learned some stuff about this in this very interesting blog.






[…] about graphical interpolation, be sure to check some great blog-posts that have come before mine (here and here, for example). After going over these posts, I was curious about the performance […]