Enum ResamplingAlgorithm
- Namespace
- PaintDotNet
- Assembly
- PaintDotNet.Core.dll
public enum ResamplingAlgorithm
Fields
NearestNeighbor = 0
A nearest neighbor interpolation algorithm. Also known as nearest pixel or point interpolation.
The output pixel is assigned the value of the pixel that the point falls within. No other pixels are considered.LinearLowQuality = 1
A bilinear interpolation algorithm. The output pixel values are computed as a weighted average of the nearest four pixels in a 2x2 grid. This is the algorithm often used in real-time computer graphics for (bi)linear filtering.
Cubic = 2
A bicubic interpolation algorithm. Specifically this is the Catmull-Rom cubic interpolation kernel, which is equivalent to the HighQualityCubic algorithm offered by WIC and Direct2D. In the family of cubic filters, this uses (b=0, c=0.5).
SuperSampling = 3
Deprecated. It is highly recommend that you not use this.
This is equivalent to Fant for down-sizing, and CubicSmooth for upsizing.
Note that the name of this was poorly chosen and should not actually be referred to as "super sampling."Fant = 4
For downsizing, destination pixel values are computed as a weighted average of the all the pixels that map to the new pixel.
For upsizing, this is equivalent to Linear.
This implements Karl M. Fant's interpolation algorithm as described in the paper, "A Nonaliasing, Real-Time Spatial Transform Technique." It is equivalent to WIC/WPF's Fant algorithm, but without the bugs (e.g. the half-pixel offset when upsizing).Linear = 5
Implements Linear (Triangle/Tent) interpolation. This is much higher quality than LinearLowQuality for downsizing, but produces the same result for upsizing.
AdaptiveFast = 6
Uses lower-quality downscaling to the nearest power of 2 to the target size. A high-quality scaler is then used to reach the final size. This uses MagicScaler's HybridScaleMode.Turbo.
Lanczos3 = 7
Uses the Lanczos filter with 3 lobes.
CubicSmooth = 8
A bicubic interpolation algorithm. In the family of cubic filters, this uses (b=1, c=0). No sharpening is employed, and the resulting image will not have any ringing artifacts.
AdaptiveHighQuality = 9
A high-quality mode that chooses an appropriate high-quality interpolator based on the ratio between the source and target sizes. This is a very good choice for resizing photos and produces a sharper result than the other resamplers.
This uses MagicScaler's default interpolation settings with HybridScaleMode.Off.