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

GMImage.SetMagick

Sets the File type magick identifier (.e.g "GIF")

Component Version macOS Windows Linux Server iOS SDK
GraphicsMagick 2.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "GMImage.SetMagick"; ImageRef; Value )   More

Parameters

Parameter Description Example
ImageRef The image reference number. 1
Value The new value.

Result

Returns "OK" on success.

Description

Sets the File type magick identifier (.e.g "GIF")

Examples

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.WriteToFile"; $Image; "/tmp/test.tif"); ]

# cleanup
Set Variable [ $Error ; Value: MBS("GMImage.Release";$Image) ]

See also

Example Databases

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 25th February 2026


GMImage.SetLogEventMask - GMImage.SetMatte