CImage:Div CImage:Exp

CImage:Divx


The Divx method divides the image pixels by a constant value.

Syntax

bResult = CImage:Divx( x )

    The value x may be passed as a number or a string.

    On success, this method returns true

    On failure, this method returns false.

Remarks

If the image has an integer data type (test using IsInteger method), division by a number x > 1 may produce a choppy image unless you use SetDatatype to change to a real data type before calling Divx.

The value x can be passed as a numeric value or a string. Using a string is the only way to pass an rgb color value but it may also be used for numeric type images.

Example

The following script fragment loads an image from the file sPath, divides by the value 1.24, 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:Divx( 1.24 )

-- perform the operation

I:Save()

 

Related Topics

CImage