GMImage.SetCompose
------------------

Sets the Composition operator to be used when composition is implicitly used (such as for image flattening).

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

MBS( "GMImage.SetCompose"; ImageRef; CompositeOperator ) 

**MBS**( **"GMImage.SetCompose";** /\* Sets the Composition operator to be used when composition is implicitly used (such as for image flattening). \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$CompositeOperator**) /\* UndefinedCompositeOp = 0, OverCompositeOp = 1, InCompositeOp = 2, OutCompositeOp = 3, AtopCompositeOp = 4, XorCompositeOp = 5, PlusCompositeOp = 6, MinusCompositeOp = 7, AddCompositeOp = 8, SubtractCompositeOp = 9, DifferenceCompositeOp = 10, MultiplyCompositeOp = 11, BumpmapCompositeOp = 12, CopyCompositeOp = 13, CopyRedCompositeOp = 14, CopyGreenCompositeOp = 15, CopyBlueCompositeOp = 16, CopyOpacityCompositeOp = 17, ClearCompositeOp = 18, DissolveCompositeOp = 19, DisplaceCompositeOp = 20, ModulateCompositeOp = 21, ThresholdCompositeOp = 22, NoCompositeOp = 23, DarkenCompositeOp = 24, LightenCompositeOp = 25, HueCompositeOp = 26, SaturateCompositeOp = 27, ColorizeCompositeOp = 28, LuminizeCompositeOp = 29, CopyCyanCompositeOp = 32, CopyMagentaCompositeOp = 33, CopyYellowCompositeOp = 34, CopyBlackCompositeOp = 35, DivideCompositeOp = 36.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| CompositeOperator | UndefinedCompositeOp = 0, OverCompositeOp = 1, InCompositeOp = 2, OutCompositeOp = 3, AtopCompositeOp = 4, XorCompositeOp = 5, PlusCompositeOp = 6, MinusCompositeOp = 7, AddCompositeOp = 8, SubtractCompositeOp = 9, DifferenceCompositeOp = 10, MultiplyCompositeOp = 11, BumpmapCompositeOp = 12, CopyCompositeOp = 13, CopyRedCompositeOp = 14, CopyGreenCompositeOp = 15, CopyBlueCompositeOp = 16, CopyOpacityCompositeOp = 17, ClearCompositeOp = 18, DissolveCompositeOp = 19, DisplaceCompositeOp = 20, ModulateCompositeOp = 21, ThresholdCompositeOp = 22, NoCompositeOp = 23, DarkenCompositeOp = 24, LightenCompositeOp = 25, HueCompositeOp = 26, SaturateCompositeOp = 27, ColorizeCompositeOp = 28, LuminizeCompositeOp = 29, CopyCyanCompositeOp = 32, CopyMagentaCompositeOp = 33, CopyYellowCompositeOp = 34, CopyBlackCompositeOp = 35, DivideCompositeOp = 36. | 1 |

### Result

Returns "OK" on success.

### Description

Sets the Composition operator to be used when composition is implicitly used (such as for image flattening).  
### See also

- [GMImage.Composite](GMImageComposite.md)
- [GMImage.GetComment](GMImageGetComment.md)
- [GMImage.GetCompose](GMImageGetCompose.md)
- [GMImage.GetVerbose](GMImageGetVerbose.md)
- [GMImage.SetComment](GMImageSetComment.md)
- [GMImage.SetVerbose](GMImageSetVerbose.md)

This function checks for a license.

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

  
[GMImage.SetComment](GMImageSetComment.md) - [GMImage.SetCompressType](GMImageSetCompressType.md)

[HTML Version](GMImageSetCompose.shtml)