CImage:Sub
The Sub method subtracts another image from the current one. The result replaces the current image.
bResult = CImage:Sub( CImage ) |
The CImage argument refers to another CImage.
On success, this method returns true.
On failure, this method returns false.
For the byte, short, and ushort pixel types, Mira handles value overflow by truncating the output pixel value at the limits for the pixel type. For example, subtracting two short images may result in pixel values as low as -65536 but Mira truncates the result at -32768. If there is a chance of overflow and you want to accommodate the values, use SetPixelType to change to a "larger" pixel_type before calling Sub.
The following script loads two images from files sPath1 and sPath2, Adds them, and saves the result of the first image back to its file:
|
-- create a new CImage |
|
-- create a new CImage |
|
-- load the first image from a file named sPath1 |
|
-- load the second image from a file named sPath2 |
|
-- perform the operation on image I |
|
|
|
|
|
|
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.