GMImage.Chop
------------

Chop image (remove vertical or horizontal subregion of image).

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

MBS( "GMImage.Chop"; ImageRef; Geometry ) 

**MBS**( **"GMImage.Chop";** /\* Chop image (remove vertical or horizontal subregion of image). \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$Geometry**) /\* The area to remove.   
A Geometry is specified as a width and height "100x200". With an optional offset "100x200+10+20".e.g. "100x200" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| Geometry | The area to remove.    A Geometry is specified as a width and height "100x200". With an optional offset "100x200+10+20". | "100x200" |

### Result

Returns "OK" on success.

### Description

Chop image (remove vertical or horizontal subregion of image).  
### Examples

Remove 200 pixel on the left:

 Set Variable \[ $Result ; Value: MBS ("GMImage.Chop"; $ImageRef ; "200x0") \]  
Remove 200 pixel on the top:

 Set Variable \[ $Result ; Value: MBS ("GMImage.Chop"; $ImageRef ; "0x200") \]  
Remove 200 pixel on the right with offset of 400:

 Set Variable \[ $Result ; Value: MBS ("GMImage.Chop"; $ImageRef ; "200x0+400") \]  
Remove 200 pixel on the bottom with offset of 400:

 Set Variable \[ $Result ; Value: MBS ("GMImage.Chop"; $ImageRef ; "0x200+0+400") \]  
Remove a 200x200 area at offset 200 by 200:

 Set Variable \[ $Result ; Value: MBS ("GMImage.Chop"; $ImageRef ; "200x200+200+200") \]  
### See also

- [GMImage.Copy](GMImageCopy.md)
- [GMImage.Crop](GMImageCrop.md)
- [GMImage.Flip](GMImageFlip.md)
- [GMImage.Flop](GMImageFlop.md)
- [GMImage.Map](GMImageMap.md)
- [GMImage.Zoom](GMImageZoom.md)

This function checks for a license.

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

  
[GMImage.Charcoal](GMImageCharcoal.md) - [GMImage.ClipMask](GMImageClipMask.md)

[HTML Version](GMImageChop.shtml)