CImage:FiltClipLow
The FiltClipLow method replaces values below a threshold value with a different value. In other words, values below the threshold are "clipped" and replaced with another value.
bResult = CImage:FiltClipLow( nClipValue, nNewValue, CRect=nil ) |
nClipValue is the threshold value, specified by a number or string.
nNewValue is the replacement value, specified by a number or string.
The region is specified by a CRect, with 1-based coordinates and may be nil.
On success, this method returns true.
On failure, false is returned.
This method examines the value of each pixel inside CRect. If value < nClipValue then the pixel is replaced with nNewValue. If CRect is omitted or passed as nil, then the entire image is processed.
If the image has a numeric pixel type and you pass an rgb string for either value, the rgb string is converted to an equivalent numeric intensity.
The following script opens an image from the file at sPath and replaces values below 0 with 0. The clipping region is constrained to the rectangle defined by columns 100:200 and rows 250:350:
|
-- Create a CImage |
|
-- Open the image from sPath. |
|
-- create a rectangle |
|
-- columns 100:200, rows 250:350 |
|
-- Clip values below 0 |
|
-- save the image |
|
-- delete the CImage from memory |
|
-- delete the CRect from memory |
CImage class, FiltClipHigh, ApplyPixelMask
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.