CImage:Xsub


The Xsub method subtracts all the pixels of an image from a constant value. The result replaces the image.

Syntax

bSuccess = CImage:Xsub( value )

where

    value is a number or a string that can be converted to a number.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

The value 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 loads an image from the file sPath, subtracts from 10000, 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:Xsub( 10000 )

-- subtract every image pixel from value 10000

Related Topics

Sub

CImage class