Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  

GMImage.InvertChannel

Inverts an image.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
GraphicsMagick 8.4 Yes Yes Yes Yes Yes

MBS( "GMImage.InvertChannel"; ImageRef; Channel )

Parameters

Parameter Description Example value
ImageRef The image reference number. 1
Channel Which channel to work with. Can be opacity, red, green or blue. The value rgb will apply effect to all three color channels. "rgb"

Result

Returns OK or error.

Description

Inverts an image.
All pixel values are negated.

This is same as MBS( "GMImage.MultiplyChannel"; ImageRef; Channel; -1; 0; 255), but a bit faster.

Examples

Invert image:

Set Variable [ $image ; Value: MBS( "GMImage.NewFromContainer"; Invert::Input ) ]
# each channel...
// Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image; "red") ]
// Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image) ]
// Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image; "blue") ]
# all channels...
Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image; "rgb") ]
Set Field [ Invert::Output ; MBS( "GMImage.WriteToPNGContainer"; $image; "output.png") ]
Set Variable [ $r ; Value: MBS( "GMImage.Destroy"; $image) ]

See also

Created 13th September 2018, last changed 13th September 2018


GMImage.Implode   -   GMImage.IsGray

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins