GMImage.Stegano
---------------

Add a digital watermark to the image (based on second image)

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

MBS( "GMImage.Stegano"; ImageRef; watermark ) 

**MBS**( **"GMImage.Stegano";** /\* Add a digital watermark to the image (based on second image) \*/  
**$ImageRef**; /\* The image reference number. \*/   
**$watermark**) /\* The image reference number.e.g. $otherRef \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | $imageRef |
| watermark | The image reference number. | $otherRef |

### Result

Returns "OK" on success.

### Description

Add a digital watermark to the image (based on second image)  
Use SteganoImage() to hide a digital watermark within the image. Recover the hidden watermark later to prove that the authenticity of an image. Offset defines the start position within the image to hide the watermark.  
  
Warning: This works in 16bit per pixel mode, so the hidden picture is gone if saving as 8 bit picture.  
### Examples

Stegano example:

 # Load both pictures as reference   
Set Variable \[ $BigImageRef ; Value: MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; Combine Pictures::BigImage ) \]   
Set Variable \[ $SmallImageRef ; Value: MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; Combine Pictures::SmallImage ) \]   
\# Add second picture as hidden picture   
Set Variable \[ $Error ; Value: MBS ( "GMImage.Stegano"; $BigImageRef ; $SmallImageRef ) \]   
Set Variable \[ $Error ; Value: MBS ( "[GMImage.SetQuality](GMImageSetQuality.md)"; $BigImageRef ; 100 ) \]   
\# Write to container and free references   
Set Field \[ Combine Pictures::Result ; MBS ( "[GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)"; $BigImageRef ) \]   
Set Variable \[ $Error ; Value: MBS ("[GMImage.Free](GMImageFree.md)";$BigImageRef ) \]   
Set Variable \[ $Error ; Value: MBS ("[GMImage.Free](GMImageFree.md)";$SmallImageRef ) \]  
### See also

- [GMImage.Free](GMImageFree.md)
- [GMImage.Negate](GMImageNegate.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromContainer](GMImageNewFromContainer.md)
- [GMImage.Segment](GMImageSegment.md)
- [GMImage.SetFont](GMImageSetFont.md)
- [GMImage.SetPage](GMImageSetPage.md)
- [GMImage.SetQuality](GMImageSetQuality.md)
- [GMImage.Stereo](GMImageStereo.md)
- [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)

This function checks for a license.

Created 18th August 2014 , last changed 9th November 2020

  
[GMImage.Statistics](GMImageStatistics.md) - [GMImage.Stereo](GMImageStereo.md)

[HTML Version](GMImageStegano.shtml)