CImage:FiltUnsharpMask
The FiltUnsharpMask method increases the crispness, or local contrast, of the image using the unsharp masking method.
bResult = CImage:FiltUnsharpMask( nSigma, CRect=nil ) |
nSigma is the sigma, or radius, of the unsharp mask filter.
nStrength is the strength of the mask relative to the image values, in the range 0.01 to 1.0.
CRect is the rectangle defining the area to process. If omitted, it defaults to nil and the entire image is processed.
On success, this method returns true.
On failure, this method returns false.
This method increases the local contrast of the image by suppressing the diffuse component of the image. This has the effect of sharpening the image, making it "crisper" in appearance. The FiltSharpen method applies a simple crispening filter which runs faster but gives a slightly noisier result.
Suppose an image is displayed in a CImageView named V. The following script applies an unsharp mask of sigma 1.0 pixels and strength 1.5 to the [100:300, 400:800] pixel region:
|
-- attach the current displayed image |
|
-- setup the rectangle to process |
|
-- apply the filter |
|
-- update the display after the scale |
|
-- done with the CRect |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.