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


Flatten the alpha channel.

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


Parameter Description Example
ImageRef The image reference number. 1


Returns OK or error.


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


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 6th May 2024

GMImage.FindColorInRow - GMImage.Flip