This class enables you to increase image sharpness by using unsharp mask technique.
Namespace:
Aurigma.GraphicsMill.Transforms
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class UnsharpMask _ Inherits MaskedBitmapTransform
public sealed class UnsharpMask : MaskedBitmapTransform
Unsharp mask is a wide-spread technique used by photographers to increase image sharpness even in precomputer times. The idea is to combine the image with the unfocused (blurred) version. This class provides BlurType and Radius to specify blur settings. During combining the algorithm calculates the difference between corresponding pixels of original and blurred image. If this difference is greater than value specified with Threshold property, algorithm adds this N percents of this difference to original pixel (N is set by Amount property). Otherwise no changes to original pixel is done. As blurred image differs from original ones mainly on the object edges, sharpening effect is achieved.
Using this technique is quite difficult to untrained user as it requires to supply three non-intuitive parameters (amount, radius, and threshold). That's why if you want to provide user easy way to manipulate image sharpness, you can use Sharpen transform which is less flexible, but much more easy-to-use.
'Sharpen image via unsharp mask Dim unsharpMask As New Aurigma.GraphicsMill.Transforms.UnsharpMask unsharpMask.Amount = 1.5 unsharpMask.Radius = 2.1 unsharpMask.Threshold = 0.04 unsharpMask.ApplyTransform(bitmap)
//Sharpen image via unsharp mask Aurigma.GraphicsMill.Transforms.UnsharpMask unsharpMask = new Aurigma.GraphicsMill.Transforms.UnsharpMask(); unsharpMask.Amount = 1.5f; unsharpMask.Radius = 2.1f; unsharpMask.Threshold = 0.04f; unsharpMask.ApplyTransform(bitmap);
Member Name | Description |
---|---|
Format8bppGrayScale | 8 bits per pixel. Grayscale. 8 bits are used for luminosity level. |
Format16bppGrayScale | 16 bits per pixel. Grayscale. All 16 bits are used for luminosity level (extended pixel format). |
Format16bppAGrayScale | 16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level. |
Format32bppAGrayScale | 32 bits per pixel. Grayscale with alpha channel. 16 bits are used for alpha channel and other 16 bits are used for luminosity level (extended pixel format). |
Format24bppRgb | 24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. |
Format32bppRgb | 32 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. The rest 8 bits are unused. |
Format32bppArgb | 32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components. |
Format48bppRgb | 48 bits per pixel. RGB. 16 bits each are used for the red, green, and blue components (extended pixel format). |
Format64bppArgb | 64 bits per pixel. RGB with alpha channel. 16 bits each are used for the alpha, red, green, and blue components (extended pixel format). |
Format32bppCmyk | 32 bits per pixel. CMYK. 8 bits each are used for the cyan, magenta, yellow, and black components. |
Format64bppCmyk | 64 bits per pixel. CMYK. 16 bits each are used for the cyan, magenta, yellow, and black components (extended pixel format). |
Format80bppAcmyk | 80 bits per pixel. CMYK with alpha channel. 16 bits each are used for the alpha, cyan, magenta, yellow, and black components (extended pixel format). |