Images often need to be resized (resampled). The process of reducing the size of an image is often called downsampling, while increasing its size is called upsampling. The challenge in performing these operations is to ensure that the visual quality of the image is preserved as much as possible. To accomplish this objective, low-pass filters are often used; this recipe explains why.
Downsampling an image
How to do it...
You might think that you can reduce the size of an image by simply eliminating some of the columns and rows of the image. Unfortunately, the resulting image will not look very nice. The following screenshot illustrates this fact by showing you a test image that is reduced by a factor of 4 with respect to its...