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 |
---|---|---|---|
LowQuality | * | * | * |
HighSpeed | * | * | * |
MediumQuality | * | * | * |
MediumSpeed | * | * | * |
HighQuality | * | * | * |
LowSpeed | * | * | * |
Bilinear | * | * | * |
NearestNeighbour | * | * | * |
Trilinear | * | ||
Anisotropic4 | * | * | |
Anisotropic9 | * | * | |
HermiteFilter | * | ||
BoxFilter | * | ||
TriangleFilter | * | ||
BellFilter | * | ||
SplineFilter | * | ||
Lanczos3Filter | * | ||
MitchellFilter | * | ||
ScaleToGray | * | ||
ScaleToColor | * |
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):
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