GMImage.SetICCColorProfile
--------------------------

Sets the ICC color profile.

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

MBS( "GMImage.SetICCColorProfile"; ImageRef; Data ) 

**MBS**( **"GMImage.SetICCColorProfile";** /\* Sets the ICC color profile. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$Data**) /\* a Container field value with an embedded file containing the profile. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| Data | a Container field value with an embedded file containing the profile. |  |

### Result

Returns "OK" on success.

### Description

Sets the ICC color profile.  
Supplied via a Blob since GraphicsMagick do not currently support formatting this data structure directly.  
If there is not already an ICC color profile, the profile is merely attached to the image without transforming the pixels. If there is already an ICC color profile (the source profile), the pixels are translated according to the source and target profiles, and the existing profile is replaced with the target profile.  
Also see [GMImage.SetRenderingIntent](GMImageSetRenderingIntent.md), which allows specifying the rendering intent if the profile is executed.  
Specifications for ICC color profiles and their usage are available from the International Color Consortium for the format of ICC color profiles.  
### Examples

Removes an existing profile:

 MBS ("GMImage.SetICCColorPRofile"; $Image ; "")  
Assigns new profile from container:

 MBS ("GMImage.SetICCColorPRofile"; $Image ; MyTable::ProfileContainer );   
Convert to CMYK by setting a new profile:

 Set Variable \[ $Result ; Value: MBS ("GMImage.SetICCColorProfile"; $BigImageRef ; Test::CMYKProfle ) \]  
### See also

- [GMImage.GetICCColorProfile](GMImageGetICCColorProfile.md)
- [GMImage.SetIPTCProfile](GMImageSetIPTCProfile.md)
- [GMImage.SetRenderingIntent](GMImageSetRenderingIntent.md)
- [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)

### Release notes

- **Version 8.4**
    - Fixed crash with [GMImage.SetIPTCProfile](http://www.mbsplugins.eu/GMImageSetIPTCProfile.shtml), [GMImage.SetICCColorProfile](http://www.mbsplugins.eu/GMImageSetICCColorProfile.shtml) and [GMImage.SetProfile](http://www.mbsplugins.eu/GMImageSetProfile.shtml) if called with empty parameter.

### Example Databases

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

### Blog Entries

- [MBS FileMaker Plugin, version 8.4pr6](https://www.mbsplugins.de/archive/2018-09-01/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 16th January 2023

  
[GMImage.SetGifDisposeMethod](GMImageSetGifDisposeMethod.md) - [GMImage.SetIPTCProfile](GMImageSetIPTCProfile.md)

[HTML Version](GMImageSetICCColorProfile.shtml)