CImage:Add
The Add method adds this image to another image. The result replaces the current image.
bResult = CImage:Add( CImage )
On success, this method returns true.
On failure, this method returns false.
For the byte, short, and ushort data types, Mira handles value overflow by truncating the output pixel value at the limits for the data type. For example, adding two short images may result in a pixel value as high as 65534 but Mira caps the result at 32767. If there is a chance of overflow and you want to accommodate the values, use SetDatatype to change to a "larger" Data type before calling Sub.
The following script fragment 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 |
|
|
|
|
|
|