Platforms to show: All Mac Windows Linux Cross-Platform
GMImageMBS.setchromaGreenPrimary(x as Double, y as Double)
Function:
Chromaticity green primary point.
Notes: e.g. x=0.3, y=0.6
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: e.g. x=0.3, y=0.6
GMImageMBS.setchromaRedPrimary(x as Double, y as Double)
Function:
Chromaticity red primary point
Notes: e.g. x=0.64, y=0.33
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: e.g. x=0.64, y=0.33
GMImageMBS.setchromaWhitePoint(x as Double, y as Double)
Function:
Chromaticity white point
Notes: e.g. x=0.3127, y=0.329
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: e.g. x=0.3127, y=0.329
GMImageMBS.SetEXIFOrientation(orientation as integer) as boolean
Function:
Sets orientation for EXIF.
Notes:
Changing orientation may need to set orientation via SetOrientation and SetEXIFOrientation. With a JPEG you have orientation both in JPEG header and in EXIF metadata.
Returns true for success and false for failure.
For new development, please use ExifTagsMBS class instead.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 18.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Changing orientation may need to set orientation via SetOrientation and SetEXIFOrientation. With a JPEG you have orientation both in JPEG header and in EXIF metadata.
Returns true for success and false for failure.
For new development, please use ExifTagsMBS class instead.
GMImageMBS.SetPicture(pic as picture, x as Integer, y as Integer)
Function:
Copies the picture into the Image at the given position.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GMImageMBS.SetPictureMask(maskpic as picture, x as Integer, y as Integer)
Function:
Copies the picture into the Image's mask at the given position.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
// this converts 32 bit PNG with alpha channel to BMP
dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim p as Picture = Picture.Open(f)
dim g as new GMImageMBS( new GMGeometryMBS(p.Width, p.Height), new GMColorGrayMBS(1.0))
g.type = g.TrueColorMatteType
g.matte = True
g.magick = "BMP"
g.SetPicture(p, 0, 0)
g.SetPictureMask(p.mask.invertMBS, 0, 0)
f = SpecialFolder.Desktop.Child("test.bmp")
g.write(f)
GMImageMBS.setPixels(x as Integer, y as Integer, columns as Integer, rows as Integer) as Ptr
Function:
Allocates a pixel cache region to store image pixels as defined by the region rectangle.
Example:
Notes:
This area is subsequently transferred from the pixel cache to the image via syncPixels.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 16.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim g as new GMImageMBS(f)
// get pointer to some pixels to write
dim x as ptr = g.setPixels(0, 0, 100, 100)
// draw a red line to the pixel buffer
dim o as Integer
for i as Integer = 0 to 99
o = 100 * i + i
x.UInt32(o * 4) = &hFFFF0000
next
// write back
g.syncPixels
// show
me.Backdrop = g.CopyPicture
GMImageMBS.setStrokeDashArray(values() as Double)
Function:
Sets stroke dash pattern.
Notes: Specify the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents a zero-terminated array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. A typical strokeDashArray array might contain the members 5 3 2 0, where the zero value indicates the end of the pattern array.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 16.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Specify the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents a zero-terminated array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. A typical strokeDashArray array might contain the members 5 3 2 0, where the zero value indicates the end of the pattern array.
GMImageMBS.shade(azimuth as Double=30.0, elevation as Double=30.0, colorShading as boolean=false)
Function:
Shade image using distant light source.
Notes: Specify azimuth and elevation as the position of the light source. By default, the shading results as a grayscale image.. Set colorShading to true to shade the red, green, and blue components of the image.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Specify azimuth and elevation as the position of the light source. By default, the shading results as a grayscale image.. Set colorShading to true to shade the red, green, and blue components of the image.
GMImageMBS.sharpen(radius as Double=0.0, sigma as Double=1.0)
Function:
Sharpen pixels in image.
Example:
Notes:
The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation of the Laplacian, in pixels.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
image.sharpen
Backdrop=image.CopyPicture
GMImageMBS.sharpenChannel(channel as Integer, radius as Double=0.0, sigma as Double=1.0)
Function:
Sharpen pixels in image channel.
Notes: The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation of the Laplacian, in pixels.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation of the Laplacian, in pixels.
GMImageMBS.shave(geometry as GMGeometryMBS)
Function:
Shave pixels from image edges.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
image.shave(new GMGeometryMBS(200,200))
Backdrop=image.CopyPicture
GMImageMBS.shear(xShearAngle as Double, yShearAngle as Double)
Function:
Shear image (create parallelogram by sliding image by X or Y axis).
Example:
Notes:
Shearing slides one edge of an image along the X or Y axis, creating a parallelogram. An X direction shear slides an edge along the X axis, while a Y direction shear slides an edge along the Y axis. The amount of the shear is controlled by a shear angle. For X direction shears, x degrees is measured relative to the Y axis, and similarly, for Y direction shears y degrees is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the color defined as borderColor.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
image.shear(10,20)
Backdrop=image.CopyPicture
GMImageMBS.signature(force as boolean=false) as string
Function:
Image textual signature.
Example:
Notes:
Set force to true in order to re-calculate the signature regardless of whether the image data has been modified.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
MsgBox image.signature
Backdrop=image.CopyPicture
GMImageMBS.solarize(factor as Double=50.0)
Function:
Solarize image (similar to effect seen when exposing a photographic film to light during the development process)
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
image.solarize
Backdrop=image.CopyPicture
GMImageMBS.spread(amount as UInt32=3)
Function:
Spread pixels randomly within image by specified ammount
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
image.spread 5
Backdrop=image.CopyPicture
GMImageMBS.statistics as GMImageStatisticsMBS
Function:
Obtain image statistics.
Example:
Notes:
Statistics are normalized to the range of 0.0 to 1.0 and are output to the specified ImageStatistics structure.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 16.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim g as new GMImageMBS(f)
dim stat as GMImageStatisticsMBS = g.statistics
dim gs as GMImageChannelStatisticsMBS = stat.blue
MsgBox "blue channel: "+str(gs.minimum)+"-"+str(Gs.maximum)+", mean "+str(gs.mean)
GMImageMBS.stegano(watermark as GMImageMBS)
Function:
Add a digital watermark to the image (based on second image).
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim p1 as Picture = New Picture(550,500,32)
dim p2 as Picture = New Picture(550,500,32)
p1.Graphics.DrawPicture p, 0,0
p2.Graphics.DrawPicture p,50,0
dim image1 as new GMImageMBS(p1)
dim image2 as new GMImageMBS(p2)
image2.zoom(new GMGeometryMBS(100,100)) // scale down
// add watermark
image1.stegano(image2)
// now make a threshold so you see the difference
image1.threshold 254
image1.type = image1.TrueColorType
Backdrop=image1.CopyPicture
GMImageMBS.stereo(rightImage as GMImageMBS)
Function:
Create an image which appears in stereo when viewed with red-blue glasses (Red image on left, blue on right)
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim p1 as Picture = New Picture(550,500,32)
dim p2 as Picture = New Picture(550,500,32)
p1.Graphics.DrawPicture p, 0,0
p2.Graphics.DrawPicture p,50,0
dim image1 as new GMImageMBS(p1)
dim image2 as new GMImageMBS(p2)
image1.stereo(IMAGE2)
Backdrop=image1.CopyPicture
GMImageMBS.strip
Function:
Remove all profiles and text attributes from the image.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 13.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GMImageMBS.strokeDashArray as Double()
Function:
Queries stroke dash pattern.
Notes: Specify the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents a zero-terminated array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. A typical strokeDashArray array might contain the members 5 3 2 0, where the zero value indicates the end of the pattern array.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 16.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Specify the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents a zero-terminated array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. A typical strokeDashArray array might contain the members 5 3 2 0, where the zero value indicates the end of the pattern array.
GMImageMBS.swirl(degree as Double)
Function:
Swirl image (image pixels are rotated by degrees).
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
image.swirl 200
Backdrop=image.CopyPicture
GMImageMBS.syncPixels
Function:
Transfers the image cache pixels to the image.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GMImageMBS.texture(texture as GMImageMBS)
Function:
Channel a texture on pixels matching image background color.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GMImageMBS.threshold(degree as Double)
Function:
Threshold image channels (below threshold becomes black, above threshold becomes white).
Example:
Notes:
The range of the threshold parameter is 0 to MaxRGB.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim p as Picture = LogoMBS(500)
dim image as new GMImageMBS(p)
image.threshold 127
// convert to RGB so CopyPicture works
image.type = image.TrueColorType
Backdrop=image.CopyPicture
GMImageMBS.thumbnail(geometry as GMGeometryMBS)
Function:
Resize image using several algorithms to make smaller images very quickly.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 16.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim g as new GMImageMBS(f)
// make thumbnail
dim geo as new GMGeometryMBS(100, 100)
g.thumbnail(geo)
// show
me.Backdrop = g.CopyPicture
GMImageMBS.transform(imageGeometry as GMGeometryMBS)
Function:
Transform image based on image and crop geometries.
Notes: Crop geometry is optional.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Crop geometry is optional.
See also:
GMImageMBS.transform(imageGeometry as GMGeometryMBS, cropGeometry as GMGeometryMBS)
Function:
Transform image based on image and crop geometries.
Notes: Crop geometry is optional.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Crop geometry is optional.
See also:
GMImageMBS.transformOrigin(tx as Double, ty as Double)
Function:
Origin of coordinate system to use when annotating with text or drawing.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GMImageMBS.transformReset
Function:
Reset transformation parameters to default.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GraphicsMagick | MBS GraphicsMagick Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The items on this page are in the following plugins: MBS GraphicsMagick Plugin.

Links
MBS Xojo blog