GMImage.Erase
-------------

Erase image to current "background color"

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

MBS( "GMImage.Erase"; ImageRef ) 

**MBS**( **"GMImage.Erase";** /\* Erase image to current "background color" \*/  
**$ImageRef**) /\* The image reference number.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |

### Result

Returns "OK" on success.

### Description

Erase image to current "background color"  
### Examples

Create a transparent picture by erasing with transparent color:

 Set Variable \[ $img ; Value: MBS ("[GMImage.New](GMImageNew.md)"; $width &amp; "x" &amp; $height ; "RGB 1 1 1") \]   
Set Variable \[ $r ; Value: MBS ( "[GMImage.SetMatte](GMImageSetMatte.md)"; $img ; 1) \]   
Set Variable \[ $r ; Value: MBS ( "[GMImage.SetBackgroundColor](GMImageSetBackgroundColor.md)"; $img ; "transparent") \]   
Set Variable \[ $r ; Value: MBS ("GMImage.Erase"; $img ) \]  
### See also

- [GMImage.DrawRoundRectangle](GMImageDrawRoundRectangle.md)
- [GMImage.Edge](GMImageEdge.md)
- [GMImage.Free](GMImageFree.md)
- [GMImage.Hash](GMImageHash.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.Raise](GMImageRaise.md)
- [GMImage.SetBackgroundColor](GMImageSetBackgroundColor.md)
- [GMImage.Shade](GMImageShade.md)
- [GMImage.Shave](GMImageShave.md)
- [GMImage.Wave](GMImageWave.md)

### Example Databases

- [Overlay](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Overlay.shtml#4ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 8th May 2020

  
[GMImage.Equalize](GMImageEqualize.md) - [GMImage.ExifThumbnail](GMImageExifThumbnail.md)

[HTML Version](GMImageErase.shtml)