ImageSampling Enum

How the color of an image is read at a position that is not the center of one of its pixels.

public enum ImageSampling

Fields

NameValueDescription
Bilinear0The four pixels around the position are interpolated, in proportion to their distances to it. This is the default. At the center of a pixel, the color is the color of that pixel, exactly.
Nearest1The pixel that contains the position: an enlarged image keeps its pixels as squares.
Smooth2ImageSampling.Bilinear for an image that is not reduced, bit for bit; for an image that is reduced, every pixel of the image a pixel of the canvas covers counts, with the weights of the interpolation stretched over them: no pixel is skipped, so a photograph drawn as a thumbnail has no aliasing.
Bicubic3The sixteen pixels around the position, with the weights of the cubic filter of Mitchell and Netravali (B = C = 1/3), as browsers draw a scaled image with high quality: smoother than ImageSampling.Bilinear when the image is enlarged, without its blur.
Box4ImageSampling.Bilinear for an image that is not reduced, bit for bit; for an image that is reduced, the average of what a pixel of the canvas covers of the image: each pixel of the image weighs the length of its part inside the columns and the rows the pixel of the canvas covers, as the box-filtered mipmaps of browsers approximate.