GMImage.Negate
--------------

Negate colors in image.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [2.0](newinversion20.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.Negate"; ImageRef; grayscale ) 

**MBS**( **"GMImage.Negate";** /\* Negate colors in image. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$grayscale**) /\* Set grayscale to only negate grayscale values in image.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| grayscale | Set grayscale to only negate grayscale values in image. | 1 |

### Result

Returns "OK" on success.

### Description

Negate colors in image.   
### Examples

Negates an image:

 Let ( \[   
$Image = MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; GraphicsMagick::image );   
$Result = MBS ("GMImage.Negate";$Image );   
$Result = MBS ("[GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)"; $Image );   
$Error = MBS ("[GMImage.Release](GMImageRelease.md)";$Image )  
\];   
$Result )  
### See also

- [GMImage.GetMatte](GMImageGetMatte.md)
- [GMImage.GetPage](GMImageGetPage.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromContainer](GMImageNewFromContainer.md)
- [GMImage.Repage](GMImageRepage.md)
- [GMImage.Resize](GMImageResize.md)
- [GMImage.Rotate](GMImageRotate.md)
- [GMImage.SetMatte](GMImageSetMatte.md)
- [GMImage.SetPage](GMImageSetPage.md)
- [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)

### Example Databases

- [GraphicsMagick/GraphicsMagick Sample](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/GraphicsMagick%20Sample.shtml#19ScriptAnchor_)

### Blog Entries

- [MBS Plugin Advent calendar: 16 - GraphicsMagick](https://www.mbsplugins.de/archive/2023-12-16/MBS_Plugin_Advent_calendar_16_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 21st December 2018

  
[GMImage.MultiplyChannel](GMImageMultiplyChannel.md) - [GMImage.New](GMImageNew.md)

[HTML Version](GMImageNegate.shtml)