CImage:Abs


The Abs method replaces the image pixels with their absolute value.

Syntax

bSuccess = CImage:Abs()

bullet.gif    On success, this method returns true

bullet.gif    On failure, this method returns false .

Remarks

The Abs operation changes all pixel values to a positive number. If the pixel type is entirely positive, like "byte" or "ushort", this operation does nothing.

Example

The following script loads an image from the file sPath, computes the absolute value of the pixel values, and saves the result back to the file:

I = new_image()

-- create a new CImage

I:Open(sPath)

-- load the image from a file named sPath

I:Abs()

-- perform the operation

I:Save()

 

Related Topics

CImage class


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.