CImage:Abs
The Abs method replaces the image pixels with their absolute value.
bSuccess = CImage:Abs()
On success, this method returns true
On failure, this method returns false .
The Abs operation changes all pixel values to a positive number. If the data type is entirely positive, like "byte" or "ushort", this operation does nothing.
The following script fragment loads an image from the file sPath, computes the absolute value of the pixel values, and saves the result back to the file:
I = CImage:new() |
-- create a new CImage |
I:Open(sPath) |
-- load the image from a file named sPath |
I:Abs() |
-- perform the operation |
I:Save() |
|