ScalingMode Enumeration
Represents the scaling mode when an image needs to be resized.
Namespace: KGySoft.DrawingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.1.0
Public Enumeration ScalingMode
public enum class ScalingMode
Auto | 0 |
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.
|
NoScaling | 1 |
Represents no scaling. When source and target sizes are different, then clipping might occur.
|
NearestNeighbor | 2 |
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.
|
Box | 3 |
Represents box scaling mode. When downscaling, the pixels will average.
When upscaling, the result is identical to NearestNeighbor.
|
Bilinear | 4 |
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%.
|
Bicubic | 5 |
Represents the bicubic interpolation. It both preserves sharpness and reduces artifacts quite well.
This is the default scaling mode when downscaling images.
|
Lanczos2 | 6 |
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.
|
Lanczos3 | 7 |
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.
|
Spline | 8 |
Represents the spline cubic interpolation. It provides smooth results but it tends to overly blur the details.
|
CatmullRom | 9 |
Represents the Catmull-Rom cubic interpolation. Similarly to the bicubic interpolation
it preserves sharpness quite well without producing strong artifacts.
|
MitchellNetravali | 10 |
Represents the Mitchell-Netravali cubic interpolation. Usually it produces very good results.
This is the default scaling mode when upscaling images.
|
Robidoux | 11 |
Represents the Robidoux cubic interpolation. It produces a very similar result to the Mitchell-Netravali interpolation.
|