Class UnsharpMaskEffect
The UnsharpMaskEffect sharpens an image by first creating a blurred version of the image. For each pixel in the image, the difference between the original pixel value and the blurred pixel value is determined. If the difference in pixel values exceeds a threshold value, the original pixel value is modified, sharpening the image.
Implements
Namespace: ImageVault.Common.Data.Effects
Assembly: ImageVault.Common.dll
Syntax
public class UnsharpMaskEffect : EffectConstructors
UnsharpMaskEffect()
Initializes a new instance of the UnsharpMaskEffect class.
Declaration
public UnsharpMaskEffect()Remarks
UnsharpMaskEffect(Double, Int32, Int32)
Initializes a new instance of the UnsharpMaskEffect class.
Declaration
public UnsharpMaskEffect(double radius, int amount, int threshold)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Double | radius | Radius | 
| System.Int32 | amount | Amount | 
| System.Int32 | threshold | Threshold | 
Properties
Amount
Defines the amount of sharpening to apply in pixels.
Declaration
public int Amount { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Remarks
This is like a volume adjustment – the higher the percentage, the stronger the sharpening effect.
Typical setting: 50-200 %
Good starting point: 100 %
Radius
Defines the width of the sharpening effect in pixels
Declaration
public double Radius { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Double | 
Remarks
Sharpening works on the edges of a subject by increasing the contrast at these points, making these outlines stand out more prominently. The higher the Radius amount, the stronger the sharpening effect. It’s measured in pixels, as this is the width of the sharpening effect.
Typical setting: 1-8 pixels
Good starting point: 1 pixel
Threshold
Defines the threshold level of the sharpening effect.
Declaration
public int Threshold { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Remarks
The higher the threshold amount is set, the lower the sharpening effect. This value defines what counts as an edge for the sharpening applied by the Amount and Radius values. At '0 levels' each pixel counts as an edge, so it is sharpened. At high values (25 levels and above, for example) only high-contrast edges are sharpened.
Typical setting: 1-15 levels
Good starting point: 5 levels
Methods
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public override object Clone()Returns
| Type | Description | 
|---|---|
| System.Object | A new object that is a copy of this instance. | 
Overrides
Equals(UnsharpMaskEffect)
Determines whether the specified UnsharpMaskEffect is equal to the current UnsharpMaskEffect.
Declaration
public bool Equals(UnsharpMaskEffect other)Parameters
| Type | Name | Description | 
|---|---|---|
| UnsharpMaskEffect | other | The UnsharpMaskEffect to compare with the current UnsharpMaskEffect. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if the specified UnsharpMaskEffect is equal to the current UnsharpMaskEffect; otherwise, false. | 
Equals(Object)
Determines whether the specified System.Object is equal to the current UnsharpMaskEffect.
Declaration
public override bool Equals(object obj)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | obj | The System.Object to compare with the current UnsharpMaskEffect. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if the specified System.Object is equal to the current UnsharpMaskEffect; otherwise, false. | 
GetHashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
Declaration
public override int GetHashCode()Returns
| Type | Description | 
|---|---|
| System.Int32 | A hash code for the current UnsharpMaskEffect. | 
ToString()
Returns a System.String that represents the current UnsharpMaskEffect.
Declaration
public override string ToString()Returns
| Type | Description | 
|---|---|
| System.String | A System.String that represents the current UnsharpMaskEffect. |