ResamplingFilter Enum

Selects the interpolation kernel used to resample pixels.

public enum ResamplingFilter

Remarks

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

NameValueDescription
NearestNeighbor0Nearest-neighbor sampling (pixel centers, no blending).
Bilinear1Bilinear (triangle) interpolation, with a support radius of 1.
Bicubic2Bicubic 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.
Lanczos33Three-lobe Lanczos windowed sinc interpolation, with a support radius of 3.
Box4Box 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.
Hermite5Hermite 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.
MitchellNetravali6The cubic of Mitchell and Netravali with B = C = 1/3, with a support radius of 2: a compromise between blur, ringing and aliasing.
Robidoux7The 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.
RobidouxSharp8The 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.
Spline9The 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.
Lanczos210Two-lobe Lanczos windowed sinc interpolation, with a support radius of 2.
Lanczos511Five-lobe Lanczos windowed sinc interpolation, with a support radius of 5.
Lanczos812Eight-lobe Lanczos windowed sinc interpolation, with a support radius of 8.