ScalingMode Enumeration

Represents the scaling mode when an image needs to be resized.

Definition

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.1.0
C#
public enum ScalingMode

Members

Auto0 Represents an automatically selected scaling mode based on source/target sizes providing the best quality. In practice, the MitchellNetravali scaling mode is selected if either the width or height is enlarged, and the Bicubic scaling mode, if there is shrinking in both dimensions. If source and target sizes are the same, then NoScaling is selected.
NoScaling1 Represents no scaling. When source and target sizes are different, then clipping might occur.
NearestNeighbor2 Represents the nearest neighbor scaling mode, which always selects the closest pixel when scaling. Apart from NoScaling this is the fastest scaling mode but provides the poorest quality.
Box3 Represents box scaling mode. When downscaling, the pixels will average. When upscaling, the result is identical to NearestNeighbor.
Bilinear4 Represents a 2-dimensional linear interpolation scaling mode. It is among the faster scaling techniques but it provides an acceptable quality only if the difference between the source and target size does not exceed 25%.
Bicubic5 Represents the bicubic interpolation. It both preserves sharpness and reduces artifacts quite well. This is the default scaling mode when downscaling images.
Lanczos26 Represents the resampling algorithm suggested by Kornél Lánczos using a kernel radius of 2 pixels. It both preserves sharpness and reduces artifacts quite well. When downscaling, acts also as a low-pass filter. The result is usually similar to the bicubic filter.
Lanczos37 Represents the resampling algorithm suggested by Kornél Lánczos using a kernel radius of 3 pixels. It is among the slower filters and it tends to increase the sharpness of the original image.
Spline8 Represents the spline cubic interpolation. It provides smooth results but it tends to overly blur the details.
CatmullRom9 Represents the Catmull-Rom cubic interpolation. Similarly to the bicubic interpolation it preserves sharpness quite well without producing strong artifacts.
MitchellNetravali10 Represents the Mitchell-Netravali cubic interpolation. Usually it produces very good results. This is the default scaling mode when upscaling images.
Robidoux11 Represents the Robidoux cubic interpolation. It produces a very similar result to the Mitchell-Netravali interpolation.

See Also