Down-sampling methods.

On this page you can find several examples of the effect that different downsampling methods have on image quality. The evaluations on this page focus mainly on the differences that common practices in Photoshop ® (CS) have on the creation of aliasing artifacts. Methods, and alternative software, for reducing the tendency for creation of such artifacts are also suggested.

For this evaluation I used a 1000x1000 pixel target with concentric cycles with a sinusoidal modulation from black (0) to white (255). The spatial frequency of the 'rings' ranges linearly from zero in the center, to one cycle (somewhat similar to 1 line pair) in the corner. The choice for a continuous tone target was made because it is a closer representation of a discrete quantization of a photographic image, such as from a scannner or digicam, than a bi-tonal pattern. Bi-tonal images, such as line drawings or to a certain extent text, may require different methods for optimal size reduction.

Rings1_small (52K)
The small size version of the 'original' target as displayed on the left is for illustration purposes only. The actual resampling tests below, are based on the larger original. A copy of the original full 1000x1000 pixel size (1294 KB) target can be downloaded here.

As you may understand, it is theoretically impossible to accurately display detail that is smaller than 1 pixel. That means that if we reduce the size of the original target with its corner detail that cycles from black to white with each pixel, the average of several cycles per pixel should be represented by a shade of gray. Unfortunately that does not always happen. In fact, massive artifacting caused by aliasing is usually the result, as can be seen in the following examples.

Photoshop® CS, Image (index mode) Resizing to 20% with Resampling
Rings1_NN (53K)
Nearest Neighbor
Rings1_BL (53K)
Rings1_BC (53K)
Rings1_BCsm (53K)
Bicubic Smoother
Rings1_BCsh (53K)
Bicubic Sharper

As you can see above, and compared to the resized result below, the original target which is saved in a GIF file format doesn't resize as well as in an RGB (or Grayscale) file mode. That happens despite the fact that it has a full 256 shades palette table, so users are warned.

Because of that, all subsequent Photoshop® operations are performed after first converting from Index mode to RGB mode.
Photoshop® CS, Image (RGB mode) Resizing to 20% with Resampling
Rings1_NNrgb (53K)
Nearest Neighbor
Rings1_BLrgb (35K)
Rings1_BCrgb (33K)
Rings1_BCsmrgb (30K)
Bicubic Smoother
Rings1_BCshrgb (35K)
Bicubic Sharper

You can see that all standard resampling methods in Photoshop ® CS still fail to avoid aliasing artifacts when downsizing. Granted, the target is hyper sensitive to aliasing because it has such a regular and high contrast pattern. However, there are software implementations that do a much better job 'out-of-the-box', although at the possible expense of being a bit slower (see ImageMagick™ examples further down below).
On most continuous-tone images with irregular detail the artifacts may be hard to detect, but the above examples show that they are present for all features smaller than 1 pixel in the end result, and as such in any down-sampled image. This may lead to enhanced visibility of graininess/noise (despite random placement), JPEG artifacts, scanned picture surface structure, or the aliasing of regular image structures like brick walls, especially when shot at an angle.

Now that we know that such small features need to be avoided, we can try and reduce high spatial frequencies before we downsize. I'll demonstrate two simple methods that will catch most of the trouble. The first method is by pre-blurring the image, thus gradually removing more detail as the spatial frequency increases. We could e.g. use a blur radius equal to the reduction factor of 5 × 0.2 = 1.0 .
Photoshop® CS, Gaussian Pre-Blur Radius 1.0, Image Resizing to 20% with Resampling
Rings1_GB10NN (41K)
Nearest Neighbor
Rings1_GB10BL (22K)
Rings1_GB10BC (21K)
Rings1_GB10BCsm (18K)
Bicubic Smoother
Rings1_GB10BCsh (21K)
Bicubic Sharper

For irregularly shaped subjects this will prevent most of the aliasing artifacts except for some pseudo detail from a few higher harmonics. This will probably be invisible for the majority of common images.
The somewhat square shaped area of higher contrast detail is what a perfect 'Sinc' filter would produce. The reason is that in a square pixel grid the diagonal resolution is approx. 41% higher than in the horizontal/vertical direction.

Now let's try a slightly more aggressive pre-blur, in the order of the reduction factor of 5 × 0.3 = 1.5 .
Photoshop® CS, Gaussian Pre-Blur Radius 1.5, Image Resizing to 20% with Resampling
Rings1_GB15NN (30K)
Nearest Neighbor
Rings1_GB15BL (17K)
Rings1_GB15BC (17K)
Rings1_GB15BCsm (15K)
Bicubic Smoother
Rings1_GB15BCsh (17K)
Bicubic Sharper

As we can see, the contrast of the higher harmonics is reduced, while the contrast of the high frequency detail is almost the same. A little small radius Unsharp Masking, or a High Pass sharpening layer, will restore the fine detail contrast. Unfortunately, note that the border pixels were not fully blurred by Photoshop®, so some residual artifacts may require cropping on some images.

Another somewhat unorthodox method for reducing high spatial frequency detail, is by averaging/binning several pixels together with the Pixelate|Mosaic filter, before down-sizing.
Photoshop® CS, Mosaic Pre-filter at 5 pixels, Image Resizing to 20% with Resampling
Rings1_Mos5NN (35K)
Nearest Neighbor
Rings1_Mos5BL (35K)
Rings1_Mos5BC (31K)
Rings1_Mos5BCsm (29K)
Bicubic Smoother
Rings1_Mos5BCsh (32K)
Bicubic Sharper

Although much better than the un-filtered result, the amplitude of the higher harmonics is more visible than with the Gaussian preblur. Again, this may produce visibly quite pleasing results, but there is a somewhat higher chance of visible aliasing artifacts from some spatial frequencies.

Finally I'll give an overview of some of the standard sampling filters of ImageMagick™, combined with the anti-aliased resizing provided by it. In my opinion, many of these pre-filters and the default anti-aliasing give superior results compared to Photoshop®, and they also don't need prior conversion to RGB mode. Edge pixels are also handled better.

Note: The following results were created with the new ImageMagick version 7, which adds several new filters, and corrects some issues with the early version 6 implementations.
ImageMagick™ 7.0.4, Image Resizing to 20% with various Resampling filters
Rings1_IM7bartlett (4KiB)
Rings1_IM7blackman (12KiB)
Rings1_IM7bohman (12KiB)
Rings1_IM7box (26KiB)
Rings1_IM7catrom (13KiB)
Rings1_IM7cosine (12KiB)
Rings1_IM7cubic (10KiB)
Rings1_IM7gaussian (12KiB)
Rings1_IM7hamming (12KiB)
Rings1_IM7hann (12KiB)
Rings1_IM7hermite (15KiB)
Rings1_IM7jinc (10KiB)
Rings1_IM7kaiser (12KiB)
Rings1_IM7lagrange (14KiB)
Rings1_IM7lanczos (12KiB)
Rings1_IM7lanczos2 (13KiB)
Rings1_IM7lanczos2sharp (13KiB)
Rings1_IM7lanczosradius (12KiB)
Rings1_IM7lanczossharp (12KiB)
Rings1_IM7mitchell (12KiB)
Rings1_IM7parzen (12KiB)
Rings1_IM7point (38KiB)
Rings1_IM7quadratic (11KiB)
Rings1_IM7robidoux (12KiB)
Rings1_IM7robidouxsharp (7K)
Rings1_IM7sinc (14KiB)
Rings1_IM7sincfast (14KiB)
Rings1_IM7spline (10KiB)
Rings1_IM7triangle (21K)
Rings1_IM7welch (12KiB)

These are the results from the default behavior of the filters with the '-resize' function. ImageMagick allows to modify the behavior with so-called 'Expert  options', so the results shown are only the beginning of what can be achieved. Some of these filters (e.g. Bessel, or Sinc/SincFast) are not recommended to be used without first setting those Expert options. Other filters, such as the Jinc and Robidoux versions, are mainly designed for another '-resize' method, i.e. the cylindrical '-distort Resize'. For more info about these 'filter' options, see this link to the -filter option. And here is a link to a better guide to using ImageMagick Filters with lots of image and code examples.

Especially the Catrom, Mitchell, and Lanczos filtering give almost perfect and well-behaved results for this type of image, in the sense of exhibiting high amplitude as resolution approaches the resolution limit and at the same time generating few artifacts for continuous-tone images.

Most of these filters produce results with a higher diagonal resolution, with the exception of the 'Jinc' filter which produces a more isotropic result, especially when used with the cylindrical resize method it was designed for. While that may lead to slightly lower resolution (on diagonals) the result is also a bit more robust against the generation of artifacts from subsequent sharpening.

Concluding we can say that if a signal is not properly pre-filtered, a discrete sampled image in a regular grid will produce aliasing or Moiré when downsized. In order to suppress aliasing it is required to pre-filter the highest spatial frequencies with a low-pass filter. This low-pass filtering will result in reduced contrast of the finest detail, and thus visible resolution, although with appropriate sharpening much of that can be restored. Noise typically tends to be reduced in proportion with the downsampling.
The examples above use a very critical test target to simulate a real life scene, so the artifacts may be less visible with actual real life scenes, but the artifacts will be present nevertheless. They may become more visible with sharpening. If we want to avoid unpleasant surprises, it is a good thing to know what to look for and how to avoid it.

Top of page

You can reach me at this e-mail address with questions, remarks, and suggestions about this page.

Designed by Bart van der Wolf Latest revision: 18-February-2017
Copyright © 2004, 2017, Bart van der Wolf Free track counters