This documentation is for the old version. Go to the latest Graphics Mill docs

Comparison of Interpolation Modes

Graphics Mill for .NET supports a lot of various interpolation modes for various transformations and effects. There are 12 different modes available. Interpolation modes are represented by the InterpolationMode enumeration. But the rich choice leads to the problem: what interpolation to use? This article is devoted to help you decide what intepolation to use in your case.

First of all, not all transformation methods support all 12 interpolation modes. The table below demonstrates what InterpolationMode members are acceptable for appropriate methods. Asteriks specifies supported method, an empty cell - unsupported one.

Member Name Resize Rotate Cylindrize, Swirl, Wave, WaterDrop
ConstantLowQuality * * *
ConstantHighSpeed * * *
ConstantMediumQuality * * *
ConstantMediumSpeed * * *
ConstantHighQuality * * *
ConstantLowSpeed * * *
ConstantBilinear * * *
ConstantNearestNeighbour * * *
ConstantTrilinear *
ConstantAnisotropic4 * *
ConstantAnisotropic9 * *
ConstantHermiteFilter *
ConstantBoxFilter *
ConstantTriangleFilter *
ConstantBellFilter *
ConstantSplineFilter *
ConstantLanczos3Filter *
ConstantMitchellFilter *
ConstantScaleToGray *
ConstantScaleToColor *

The first six rows of this table represents not the interpolation algorithms, but automatic interpolation modes. It means that any time you specify one of these values, the method automatically selects an appropriate interpolation mode, so it is not necessary for you to check whether the mode you specify works for this method. Actually there are only three automatic interpolation modes (the other three modes are just aliases of them):

  1. LowQuality = HighSpeed. Always selects the nearest neighbour algorithm.
  2. MediumQuality = MediumSpeed. Where possible selects bilinear algorithm, if it is not available, an alternative one is selected. Scale-to-gray mode is selected for resizing 1 bpp images.
  3. HighQuality = LowSpeed. Always selects the best-quality (but slowest speed) algorithm. Scale-to-gray mode is selected for resizing 1 bpp images.

Examples of various interpolation modes with distortion methods (Cylindrize, Swirl, Wave, and WaterDrop) are adduced below. These methods can use the nearest neighbour, bilinear, anisotropic with 4 points and anisotropic with 9 points algorithms. Besides, a sample of high quality image produced using supersampling technique described in Interpolation Inside section is demonstrated. These examples should help you estimate the quality of each of these algorithms.

Original Image

Supersampling 4x (not supported directly)

Nearest Neigbour

Bilinear

Anisotropic 4

Anisotropic 9