Image resizing can increase or decrease the size of a digital image using explicit scaling or automatic programs. Scaling can use subsampling to maintain quality, while increasing size requires algorithms to approximate missing pixels. Three types of algorithms include copying pixels, interpolating surrounding colors, and pattern recognition. Resizing can also reduce image size by averaging pixels.
Image resizing is a computer graphics process that increases or decreases the size of a digital image. An image can be scaled explicitly with an image viewer or editing software, or it can be done automatically by a program to fit an image to a different sized area. Scaling an image, such as creating thumbnail images, can use several methods, but largely employs a type of sampling called subsampling to reduce the image and maintain the original quality. Increasing the size of an image can be more complex, because the number of pixels required to fill the larger area is greater than the number of pixels in the original image. When using image scaling to increase the size of an image, one of several algorithms is used to approximate the color of the extra pixels in the larger image.
There are three main types of algorithms that can be used in image resizing to increase the size of an image. The simplest version takes each original pixel in the source image and copies it to its corresponding location in the larger image. This will leave gaps between pixels in the larger image which are filled in by giving the empty pixels the color of the source pixel to the left of their current position. This, in effect, multiplies an image and its data into a larger area. Although this method, called closer, is effective in preventing data loss, the resulting quality after resizing the image usually suffers, because the enlarged blocks of individual pixels will be clearly visible.
Other image scaling algorithms work by filling in the gaps in an enlarged image with pixels whose color is determined by the color of the pixels surrounding it. These algorithms, called bilinear interpolation and bicubic interpolation, essentially average the color of the source pixels surrounding a given pixel, then fill in the gaps in the larger image with the calculated color average. While the results are smoother than scaling your closest neighbor image, images that are scaled too large can become blurry and full of indistinct blocks of color.
A third type of image scaling algorithm uses a form of pattern recognition to identify different areas of an image that are being enlarged and then attempts to texture the missing pixels. This method can produce good results, but it can also start creating visual artifacts within an image the more times the algorithm is applied. Resizing images in this way is potentially computationally expensive for color photographic images, and can also require more memory than other types of scaling.
Image resizing can also be used to reduce the size of a digital image. The smaller image will have fewer pixels than the source image, so most algorithms will give good enough results. The algorithms for reducing the size of an image are similar to those used for increasing the size, although the process is done in reverse. The pixels in the source image are averaged over an area and combined into a single pixel which is placed in the new smaller image at the appropriate location.
Protect your devices with Threat Protection by NordVPN