ResamplingFilter Enum
Selects the interpolation kernel used to resample pixels.
public enum ResamplingFilterRemarks
When downsampling, kernel support is widened proportionally to the scale factor and coefficients are normalized.
The kernels of ResamplingFilter.NearestNeighbor, ResamplingFilter.Box, ResamplingFilter.Bilinear, ResamplingFilter.Hermite, ResamplingFilter.Bicubic and the Lanczos filters interpolate: an axis that keeps its size and position keeps its pixels. ResamplingFilter.MitchellNetravali, ResamplingFilter.Robidoux, ResamplingFilter.RobidouxSharp and ResamplingFilter.Spline do not: they also smooth such an axis, for example the width of an image whose height only changes. A resize that keeps the whole image in place leaves it unchanged whatever the filter.
Fields
| Name | Value | Description |
|---|---|---|
NearestNeighbor | 0 | Nearest-neighbor sampling (pixel centers, no blending). |
Bilinear | 1 | Bilinear (triangle) interpolation, with a support radius of 1. |
Bicubic | 2 | Bicubic Catmull-Rom interpolation (the cubic of Mitchell and Netravali with B = 0 and C = 1/2), with a support radius of 2. This is the default of ResizeOptions.Filter. |
Lanczos3 | 3 | Three-lobe Lanczos windowed sinc interpolation, with a support radius of 3. |
Box | 4 | Box filter (area averaging): each output pixel is the average of the source pixels whose centers lie in its footprint, the boundary at its end included. The footprints of an integer downscale factor tile the source exactly, which makes this the filter of choice for such reductions; when upsampling, it selects the same pixels as ResamplingFilter.NearestNeighbor. |
Hermite | 5 | Hermite cubic interpolation (the cubic of Mitchell and Netravali with B = 0 and C = 0): 2|x|^3 - 3|x|^2 + 1, with a support radius of 1. Smoother than ResamplingFilter.Bilinear, without overshoot. |
MitchellNetravali | 6 | The cubic of Mitchell and Netravali with B = C = 1/3, with a support radius of 2: a compromise between blur, ringing and aliasing. |
Robidoux | 7 | The Robidoux cubic: the Keys cubic (C = (1 - B) / 2) with B = 12 / (19 + 9 sqrt(2)), about 0.3782, with a support radius of 2. Close to ResamplingFilter.MitchellNetravali, slightly sharper. |
RobidouxSharp | 8 | The sharp Robidoux cubic: the Keys cubic (C = (1 - B) / 2) with B = 6 / (13 + 7 sqrt(2)), about 0.2620, with a support radius of 2. Between ResamplingFilter.Robidoux and ResamplingFilter.Bicubic. |
Spline | 9 | The cubic B-spline (the cubic of Mitchell and Netravali with B = 1 and C = 0), with a support radius of 2: the smoothest cubic, without overshoot. |
Lanczos2 | 10 | Two-lobe Lanczos windowed sinc interpolation, with a support radius of 2. |
Lanczos5 | 11 | Five-lobe Lanczos windowed sinc interpolation, with a support radius of 5. |
Lanczos8 | 12 | Eight-lobe Lanczos windowed sinc interpolation, with a support radius of 8. |