This documentation is for the old version. Go to the latest Graphics Mill docs

UnsharpMask Class

This class enables you to increase image sharpness by using unsharp mask technique.

Namespace: Aurigma.GraphicsMill.Transforms
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public NotInheritable Class UnsharpMask _
	Inherits MaskedBitmapTransform
C#
public sealed class UnsharpMask : MaskedBitmapTransform

Remarks

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.

Examples

Visual Basic
'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)
C#
//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);

Inheritance Hierarchy

Thread Safety

Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.

Supported Pixel Formats

Member NameDescription
Format8bppGrayScale8 bits per pixel. Grayscale. 8 bits are used for luminosity level.
Format16bppGrayScale16 bits per pixel. Grayscale. All 16 bits are used for luminosity level (extended pixel format).
Format16bppAGrayScale16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level.
Format32bppAGrayScale32 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).
Format24bppRgb24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components.
Format32bppRgb32 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. The rest 8 bits are unused.
Format32bppArgb32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components.
Format48bppRgb48 bits per pixel. RGB. 16 bits each are used for the red, green, and blue components (extended pixel format).
Format64bppArgb64 bits per pixel. RGB with alpha channel. 16 bits each are used for the alpha, red, green, and blue components (extended pixel format).
Format32bppCmyk32 bits per pixel. CMYK. 8 bits each are used for the cyan, magenta, yellow, and black components.
Format64bppCmyk64 bits per pixel. CMYK. 16 bits each are used for the cyan, magenta, yellow, and black components (extended pixel format).
Format80bppAcmyk80 bits per pixel. CMYK with alpha channel. 16 bits each are used for the alpha, cyan, magenta, yellow, and black components (extended pixel format).

See Also

Reference