Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.5   11.0   11.1   11.2   11.3   11.4   11.5   12.0   12.1   12.2    Statistic    FMM    Blog  


Loads a picture from the given container.

Component Version macOS Windows Linux Server iOS SDK License
GraphicsMagick 2.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes Paid
MBS( "GMImage.NewFromContainer"; data )   More


Parameter Description Example
data A value from a Container Field.
Can include various image formats like JPEG, PNG or just containers with FILE data.


Returns the ImageRef number on success.


Loads a picture from the given container.
Please call GMImage.Release later to free memory for this image.
Image reference numbers are starting at 18000 and counting up for each new image.

If image doesn't load, please check whether it's a HEIC, HEIF or RAW image. For those, please use Container.ReadImage first to convert on macOS/iOS.


Show with and height

Let ( [
$Image = MBS("GMImage.NewFromContainer"; GraphicsMagick::image);
$Width = MBS("GMImage.GetWidth";$Image);
$Height = MBS("GMImage.GetHeight";$Image);
$Error = MBS("GMImage.Release";$Image)
$Width & " x " & $Height )

Load from container:

MBS( "GMImage.NewFromContainer"; test::test)

See also

Release notes

  • Version 9.5
    • Improved JPEG detection for byte streams, so we can detect if a PNG is actually a JPEG. Now GMImage.NewFromContainer can read JPEG, GIF, PNG, TIFF and BMP even if they are passed in wrong container format.
  • Version 9.0
  • Version 8.3
  • Version 7.2

Example Databases

Blog Entries

Created 18th August 2014, last changed 27th November 2020

GMImage.NewFromBase64 - GMImage.NewFromFile

Feedback: Report problem or ask question.

Start Chat