PeachImage

PeachImage

ResamplingFilter Enum

The resampling filter used to reconstruct pixel values when resizing an Image.

public enum ResamplingFilter

Fields

Bicubic 0

Keys’ cubic convolution (a = -0.5) — a good general-purpose default; matches most photo editors’ “Bicubic”. Numerically identical to CatmullRom.

Box 1

Nearest-pixel averaging filter: fast, but blurs upscales and can alias downscales more than the other filters here.

CatmullRom 2

The generalized cubic convolution filter with (B, C) = (0, 0.5) — a common sharper alternative to Bicubic’s identical formula.

Hermite 3

The generalized cubic convolution filter with (B, C) = (0, 0), a softer cubic than CatmullRom.

Lanczos2 4

Windowed-sinc filter with a 2-pixel window — the smallest, fastest, and softest of the Lanczos filters here.

Lanczos3 5

Windowed-sinc filter with a 3-pixel window — a common general-purpose sharp resampler.

Lanczos5 6

Windowed-sinc filter with a 5-pixel window — sharper than Lanczos3, more prone to ringing.

Lanczos8 7

Windowed-sinc filter with an 8-pixel window — the sharpest and slowest of the Lanczos filters here.

MitchellNetravali 8

The generalized cubic convolution filter with (B, C) = (1/3, 1/3), a widely-used balance between sharpness and ringing.

NearestNeighbor 9

Copies the closest source pixel with no blending — the fastest filter, and the only one that never introduces new colors.

Robidoux 10

The generalized cubic convolution filter tuned to minimize both ringing and aliasing (B ≈ 0.3782, C ≈ 0.3109).

RobidouxSharp 11

A sharper variant of Robidoux (B ≈ 0.2620, C ≈ 0.3690).

Spline 12

The generalized cubic convolution filter with (B, C) = (1, 0) — a soft, uniform B-spline blur.

Bilinear 13

Linear interpolation between the two nearest source pixels on each axis.

Welch 14

Sinc windowed by the Welch (parabolic) window — a softer alternative to the Lanczos filters.