CImage:Abs


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

Syntax

bSuccess = CImage:Abs()

where

    bSuccess is the returned success code. On success it is true, otherwise 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.

Example

The following script loads an image from the file sPath and replaces all values by their absolute value:

I = CImage:new()

-- create a new CImage

I:Open(sPath)

-- load the image from a file named sPath

I:Abs()

-- perform the operation

Related Topics

CImage class, Chs, Math Operators