Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

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 4.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "GMImage.WriteToTiffContainer"; ImageRef { ; FileName } )   More

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, GMImage.WriteToJPEGContainer, GMImage.WriteToPNGContainer, GMImage.WriteToBMPContainer and GMImage.WriteToGIFContainer.

See Plugin.SetPreviewSize 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"; GraphicsMagick::image); ]

# make black and white with threshold
Set Variable [ $Result ; Value: MBS("GMImage.Threshold";$Image; 127); ]

# mark as monochrome image
Set Variable [ $Result ; Value: MBS("GMImage.SetMonochrome";$Image; 1); ]

# set type to 1 for black/white
Set Variable [ $Result ; Value: MBS("GMImage.SetType";$Image; 1); ]

# set to use TIFF for compression
Set Variable [ $Result ; Value: MBS("GMImage.SetMagick";$Image; "TIFF"); ]

# set to use CCITT 4 Fax compression
Set Variable [ $Result ; Value: MBS("GMImage.SetCompressType";$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";$Image) ]

See also

Example Databases

Blog Entries

This function checks for a license.

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


GMImage.WriteToPNGContainer - GMImage.WriteToWebPContainer