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

GMImage.Flatten

Flatten the alpha channel.

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

Parameters

Parameter Description Example
ImageRef The image reference number. 1

Result

Returns OK or error.

Description

Flatten the alpha channel.
Please set background color to define what color goes into the transparent areas.

Examples

Removes alpha channel:

# Load from container
Set Variable [ $BigImageRef ; Value: MBS("GMImage.NewFromContainer"; Test::BigImage) ]
# set the color to use for transparent areas
Set Variable [ $Result ; Value: MBS("GMImage.SetBackgroundColor"; $BigImageRef; "white") ]
# and remove transparency
Set Variable [ $Result ; Value: MBS("GMImage.Flatten"; $BigImageRef) ]
# Store output and release the image
Set Field [ Test::Result Test::Result ; MBS( "GMImage.WriteToJPEGContainer"; $BigImageRef ) MBS( "GMImage.WriteToJPEGContainer"; $BigImageRef ) ]
Set Variable [ $Error ; Value: MBS("GMImage.Free";$BigImageRef) ]

See also

Release notes

  • Version 14.2

Example Databases

Blog Entries

This function checks for a license.

Created 6th May 2024, last changed 12nd June 2024


GMImage.FindColorInRow - GMImage.Flip