GMImage.ClipMask
----------------

Associate a clip mask with the image.

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

MBS( "GMImage.ClipMask"; ImageRef; clipMask ) 

**MBS**( **"GMImage.ClipMask";** /\* Associate a clip mask with the image. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$clipMask**) /\* The image reference number.e.g. 2 \*/ 

### Parameters

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

### Result

Returns "OK" on success.

### Description

Associate a clip mask with the image.   
The clip mask must be the same dimensions as the image. Pass an invalid image to unset an existing clip mask.  
Returns an error in case there is no clip mask.  
### See also

- [GMImage.ClipPath](GMImageClipPath.md)
- [GMImage.GetClipMask](GMImageGetClipMask.md)

This function checks for a license.

Created 18th August 2014 , last changed 25th January 2024

  
[GMImage.Chop](GMImageChop.md) - [GMImage.ClipPath](GMImageClipPath.md)

[HTML Version](GMImageClipMask.shtml)