Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   Crossplatform   Server (Not)   Client   Components   Old   Guides
New in version: 5.0   5.1   5.2   5.3   5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1    Statistic  

GMImage.SetQuality

Sets the JPEG/MIFF/PNG compression level (default 75).

Component: GraphicsMagick
Version: 2.0
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "GMImage.SetQuality"; ImageRef; quality )

Parameters

Parameter Description Example value
ImageRef The image reference (a number returned from the GMImage.New functions) 1
quality a number in range of 0 to 100. 75

Result

Returns "OK" on success.

Description

Sets the JPEG/MIFF/PNG compression level (default 75).

Examples

Recompresses the image with JPEG compressor and a really bad quality:

Let ( [
$Image = MBS("GMImage.NewFromContainer"; GraphicsMagick::image);
$Result = MBS("GMImage.SetQuality";$Image; 5);
$Result = MBS("GMImage.WriteToJPEGContainer"; $Image);
$Error = MBS("GMImage.Destroy";$Image)
];
$Result)

Converts to JPEG with 90% compression:

Set Variable [$ImageRef; Value:MBS("GMImage.NewFromContainer"; Test::BigImage)]
Set Variable [$Result; Value:MBS("GMImage.SetQuality"; $ImageRef; 90)]
Set Field [Test::Result; MBS( "GMImage.WriteToJPEGContainer"; $ImageRef )]
Set Variable [$Error; Value:MBS("GMImage.Destroy";$ImageRef)]

See also


GMImage.SetPage   -   GMImage.SetQuantizeColorSpace

Feedback: Report problem or ask question.




Links
MBS Real Studio Plugins - Förderverein St. Arnulf Nickenich