Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

GMImage.SetCompressType

Sets the compression type.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
GraphicsMagick 2.0 Yes Yes Yes Yes Yes

MBS( "GMImage.SetCompressType"; ImageRef; CompressionType )

Parameters

Parameter Description Example value
ImageRef The image reference number. 1
CompressionType UndefinedCompression = 0, NoCompression = 1, BZipCompression = 2, FaxCompression = 3, Group4Compression = 4, JPEGCompression = 5, LosslessJPEGCompression = 6, LZWCompression = 7, RLECompression = 8, ZipCompression = 9 1

Result

Returns "OK" on success.

Description

Sets the compression type.

Examples

Convert image to 1 bit TIFF:

# Load from container
$Image = MBS("GMImage.NewFromContainer"; GraphicsMagick::image);

# make black and white with threshold
$Result = MBS("GMImage.Threshold";$Image; 127);

# mark as monochrome image
$Result = MBS("GMImage.SetMonochrome";$Image; 1);

# set type to 1 for black/white
$Result = MBS("GMImage.SetType";$Image; 1);

# set to use TIFF for compression
$Result = MBS("GMImage.SetMagick";$Image; "TIFF");

# set to use CCITT 4 Fax compression
$Result = MBS("GMImage.SetCompressType";$Image; 4);

# and write to a file
$Result = MBS("GMImage.WriteToFile"; $Image; "/tmp/test.tif");

# cleanup
$Error = MBS("GMImage.Destroy";$Image)

See also


GMImage.SetCompose   -   GMImage.SetDebug

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins