CImage:Byteswap CImage:Div

CImage:Chs


The Chs method changes the sign of the pixels in the image.

Syntax

bResult = CImage:Chs()

Remarks

The Chs operation changes positive pixel value to negative ones and vice versa. If the data type is entirely positive, like "byte" or "ushort", this operation does nothing.

Example

The following script fragment loads an image from the file sPath, changes the sign 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:Chs()

-- perform the operation

I:Save()

 

Related Topics

CImage