UnsharpMask

Syntax

Document.UnsharpMask ( Type, MaskWeight, GeoMeanMask, Cutoff[, MinPixel, MaxPixel, ShrinkPixels, FadePixels ] )

Parameters

LowpassFilterType Type - type of low-pass filter to be used

mxFFTLowPass (0) : Fast Fourier Transform low pass filter

mxKernelLowPass (1) : Kernel low pass filter using 3x3 neighbourhoods

mxKernelLowPassMore (2) : Kernel low pass filter using 5x5 neighbourhoods

Float MaskWeight - specifies percentage of low pass filtered image to subtract

Boolean GeoMeanMask - specifies use of a geometric, rather than arithmetic, mean

Float Cutoff - radius of filter cutoff as percentage of image size for FFT filter; has no effect on kernel filters

VARIANT MinPixel - [optional] Minimum value of pixels to be filtered

VARIANT MaxPixel - [optional]  Maximum value of pixels to be filtered

VARIANT ShrinkPixels - [optional] Additional distance criterion for pixels to be filtered: a pixel within this distance of a pixel less than MinPixel or greater than MaxPixel is not affected by the filter

VARIANT FadePixels - [optional] Distance at the boundary between protected and filtered pixels over which the effect of the filter is blended

Returns

Nothing

Remarks

Sharpens the image using an unsharp mask which involves subtracting some fraction of a low-pass filtered version of the image from the image itself. Type specifies which of MaxIm DL's low pass filter methods is applied to the image. When using the FFT filter, the Cutoff parameter controls its strength; 5% corresponds to a mild filter, 2.5% to medium, and 1.5% to hard. (These values are for illustration: any desired values can be used.) Cutoff is ignored when using a Kernel low pass filter. The low pass filtered image is reduced to Weight percent and subtracted from the original.

The MinPixel, MaxPixel, ShrinkPixels and FadePixels are all optional, but either all or none must be specified. They correspond to the control parameters of the Pixel Range Restriction subdialog of the Unsharp Mask dialog. MinPixel and MaxPixel should be VARIANTs of subtype Single (or convertible to Single); ShrinkPixels and FadePixels should be VARIANTs of subtype Long (or convertible to Long). If the restrictions are set so stringently that no pixels qualify for filtering, UnsharpMask throws an exception.

This method is equivalent to the Unsharp Mask command.