GMImage.WriteToTiffContainer
----------------------------

Writes the picture in TIFF format to a container value which you can store in a container field.

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

MBS( "GMImage.WriteToTiffContainer"; ImageRef { ; FileName } ) 

**MBS**( **"GMImage.WriteToTiffContainer";** /\* Writes the picture in TIFF format to a container value which you can store in a container field. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$FileName**) /\* Optional; The file name to use for the container. Default is "image.tif"e.g. "ball.tif" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ImageRef | The image reference number. | 1 |  |
| FileName | The file name to use for the container. Default is "image.tif" | "ball.tif" | Optional |

### Result

Returns a container value.

### Description

Writes the picture in TIFF format to a container value which you can store in a container field.  
For preview a JPEG version is included as well as a file name "image.tif" and the image size.  
See also [GMImage.WriteToFile](GMImageWriteToFile.md), [GMImage.WriteToJPEGContainer](GMImageWriteToJPEGContainer.md), [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md), [GMImage.WriteToBMPContainer](GMImageWriteToBMPContainer.md) and [GMImage.WriteToGIFContainer](GMImageWriteToGIFContainer.md).  
  
See [Plugin.SetPreviewSize](PluginSetPreviewSize.md) to control size of preview picture.  
### Examples

Get a container value from the picture in Tiff format.

 MBS ( "GMImage.WriteToTIFFContainer"; $MyImageRef ; "logo.tif" )  
Convert image to 1 bit TIFF:

 # Load from container   
Set Variable \[ $Image ; Value: MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; GraphicsMagick::image ); \]  
  
\# make black and white with threshold   
Set Variable \[ $Result ; Value: MBS ("[GMImage.Threshold](GMImageThreshold.md)";$Image ; 127); \]  
  
\# mark as monochrome image   
Set Variable \[ $Result ; Value: MBS ("[GMImage.SetMonochrome](GMImageSetMonochrome.md)";$Image ; 1); \]  
  
\# set type to 1 for black/white   
Set Variable \[ $Result ; Value: MBS ("[GMImage.SetType](GMImageSetType.md)";$Image ; 1); \]  
  
\# set to use TIFF for compression   
Set Variable \[ $Result ; Value: MBS ("[GMImage.SetMagick](GMImageSetMagick.md)";$Image ; "TIFF"); \]  
  
\# set to use CCITT 4 Fax compression   
Set Variable \[ $Result ; Value: MBS ("[GMImage.SetCompressType](GMImageSetCompressType.md)";$Image ; 4); \]  
  
\# and write to a file   
Set Variable \[ $Result ; Value: MBS ("GMImage.WriteToTiffContainer"; $Image ; "test.tif"); \]  
  
\# cleanup   
Set Variable \[ $Error ; Value: MBS ("[GMImage.Release](GMImageRelease.md)";$Image ) \]  
### See also

- [GMImage.SetCompressType](GMImageSetCompressType.md)
- [GMImage.SetMagick](GMImageSetMagick.md)
- [GMImage.SetMonochrome](GMImageSetMonochrome.md)
- [GMImage.SetType](GMImageSetType.md)
- [GMImage.WriteToBMPContainer](GMImageWriteToBMPContainer.md)
- [GMImage.WriteToFile](GMImageWriteToFile.md)
- [GMImage.WriteToPDFContainer](GMImageWriteToPDFContainer.md)
- [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)
- [GMImage.WriteToWebPContainer](GMImageWriteToWebPContainer.md)
- [Plugin.SetPreviewSize](PluginSetPreviewSize.md)

### Example Databases

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

### Blog Entries

- [GraphicsMagick in FileMaker, part 3](https://www.mbsplugins.de/archive/2022-12-03/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [\[ANN\] MBS FileMaker Plugin 4.4 for OS X/Windows - More than 2800 Functions In One Plugin](https://www.mbsplugins.de/archive/2014-11-11/[ANN]_MBS_FileMaker_Plugin_44_/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.4pr6](https://www.mbsplugins.de/archive/2014-10-20/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 16th October 2014 , last changed 25th February 2026

  
[GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md) - [GMImage.WriteToWebPContainer](GMImageWriteToWebPContainer.md)

[HTML Version](GMImageWriteToTiffContainer.shtml)