Platforms to show: All Mac Windows Linux Cross-Platform

Back to GMImageMBS class.

Next items

GMImageMBS.adaptiveThreshold(width as UInt32, height as UInt32, offset as double = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Apply adaptive thresholding to the image.

see:
http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm

Adaptive thresholding is useful if the ideal threshold level is not known in advance, or if the illumination gradient is not constant across the image. Adaptive thresholding works by evaulating the mean (average) of a pixel region (size specified by width and height) and using the mean as the thresholding value. In order to remove residual noise from the background, the threshold may be adjusted by subtracting a constant offset (default zero) from the mean to compute the threshold.

GMImageMBS.addNoise(noise as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Add noise to image with the specified noise type.
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.addNoise(image.GaussianNoise)

Backdrop=image.CopyPicture

Use one of this constants: GaussianNoise, ImpulseNoise, LaplacianNoise, MultiplicativeGaussianNoise, PoissonNoise, UniformNoise.

GMImageMBS.addNoiseChannel(channel as Integer, noise as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Add noise to an image channel with the specified noise type. The channel parameter specifies the channel to add noise to.
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.addNoiseChannel(image.BlueChannel, image.ImpulseNoise)

Backdrop=image.CopyPicture

The noiseType parameter specifies the type of noise.
Use one of this constants: GaussianNoise, ImpulseNoise, LaplacianNoise, MultiplicativeGaussianNoise, PoissonNoise, UniformNoise.

GMImageMBS.affineTransform(sx as Double, sy as Double, rx as Double, ry as Double, tx as Double, ty as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies an affine transformation to the drawing matrix.

Specify a transformation matrix to adjust scaling, rotation, and translation (coordinate transformation) for subsequently drawn objects in the same or decendent drawing context. The sx & sy parameters represent the x & y scale factors, the rx & ry parameters represent the x & y rotation, and the tx & ty parameters represent the x & y translation.

GMImageMBS.annotate(text as string, boundingArea as GMGeometryMBS, gravity as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Annotate using specified text, bounding area, and placement gravity.

Annotate image (draw text on image)

Gravity effects text placement in bounding area according to these rules:

NorthWestGravitytext bottom-left corner placed at top-left
NorthGravitytext bottom-center placed at top-center
NorthEastGravitytext bottom-right corner placed at top-right
WestGravitytext left-center placed at left-center
CenterGravitytext center placed at center
EastGravitytext right-center placed at right-center
SouthWestGravitytext top-left placed at bottom-left
SouthGravitytext top-center placed at bottom-center
SouthEastGravitytext top-right placed at bottom-right

Annotate annotates an image with text. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:

%b file size in bytes. %c comment. %d directory in which the image resides. %e extension of the image file. %f original filename of the image. %h height of image. %i filename of the image. %k number of unique colors. %l image label. %m image file format. %n number of images in a image sequence. %o output image filename. %p page number of the image. %q image depth (8 or 16). %p page number of the image. %q image depth (8 or 16). %s image scene number. %t image filename without any extension. %u a unique temporary filename. %w image width. %x x resolution of the image. %y y resolution of the image.

Set a font with full path and @ in front. e.g. "@/Library/Fonts/Arial.ttf". This way the plugin loads it directly.

See also:

GMImageMBS.annotate(text as string, boundingArea as GMGeometryMBS, gravity as Integer, degrees as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Annotate with text using specified text, bounding area, placement gravity, and rotation.

Annotate image (draw text on image)

Gravity effects text placement in bounding area according to these rules:

NorthWestGravitytext bottom-left corner placed at top-left
NorthGravitytext bottom-center placed at top-center
NorthEastGravitytext bottom-right corner placed at top-right
WestGravitytext left-center placed at left-center
CenterGravitytext center placed at center
EastGravitytext right-center placed at right-center
SouthWestGravitytext top-left placed at bottom-left
SouthGravitytext top-center placed at bottom-center
SouthEastGravitytext top-right placed at bottom-right

Annotate annotates an image with text. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:

%b file size in bytes. %c comment. %d directory in which the image resides. %e extension of the image file. %f original filename of the image. %h height of image. %i filename of the image. %k number of unique colors. %l image label. %m image file format. %n number of images in a image sequence. %o output image filename. %p page number of the image. %q image depth (8 or 16). %p page number of the image. %q image depth (8 or 16). %s image scene number. %t image filename without any extension. %u a unique temporary filename. %w image width. %x x resolution of the image. %y y resolution of the image.

Set a font with full path and @ in front. e.g. "@/Library/Fonts/Arial.ttf". This way the plugin loads it directly.

See also:

GMImageMBS.annotate(text as string, gravity as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Annotate with text (bounding area is entire image) and placement gravity.
Example
Var White as new GMColorGrayMBS(1)
Var Black as new GMColorGrayMBS(0)
Var geo as new GMGeometryMBS("300x200")

Var g as new GMImageMBS(geo, White)

g.antiAlias = False
g.fillColor = Black
g.lineWidth = 1
g.strokeColor = Black
g.font = "@/Library/Fonts/Tahoma.ttf"
g.fontPointsize = 15

g.annotate("Hello World", g.SouthGravity)

Backdrop = g.CopyPicture

Annotate image (draw text on image)

Gravity effects text placement in bounding area according to these rules:

NorthWestGravitytext bottom-left corner placed at top-left
NorthGravitytext bottom-center placed at top-center
NorthEastGravitytext bottom-right corner placed at top-right
WestGravitytext left-center placed at left-center
CenterGravitytext center placed at center
EastGravitytext right-center placed at right-center
SouthWestGravitytext top-left placed at bottom-left
SouthGravitytext top-center placed at bottom-center
SouthEastGravitytext top-right placed at bottom-right

Annotate annotates an image with text. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:

%b file size in bytes. %c comment. %d directory in which the image resides. %e extension of the image file. %f original filename of the image. %h height of image. %i filename of the image. %k number of unique colors. %l image label. %m image file format. %n number of images in a image sequence. %o output image filename. %p page number of the image. %q image depth (8 or 16). %p page number of the image. %q image depth (8 or 16). %s image scene number. %t image filename without any extension. %u a unique temporary filename. %w image width. %x x resolution of the image. %y y resolution of the image.

Set a font with full path and @ in front. e.g. "@/Library/Fonts/Arial.ttf". This way the plugin loads it directly.

See also:

GMImageMBS.annotate(text as string, location as GMGeometryMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Annotate using specified text, and placement location.

Annotate image (draw text on image)

Gravity effects text placement in bounding area according to these rules:

NorthWestGravitytext bottom-left corner placed at top-left
NorthGravitytext bottom-center placed at top-center
NorthEastGravitytext bottom-right corner placed at top-right
WestGravitytext left-center placed at left-center
CenterGravitytext center placed at center
EastGravitytext right-center placed at right-center
SouthWestGravitytext top-left placed at bottom-left
SouthGravitytext top-center placed at bottom-center
SouthEastGravitytext top-right placed at bottom-right

Annotate annotates an image with text. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:

%b file size in bytes. %c comment. %d directory in which the image resides. %e extension of the image file. %f original filename of the image. %h height of image. %i filename of the image. %k number of unique colors. %l image label. %m image file format. %n number of images in a image sequence. %o output image filename. %p page number of the image. %q image depth (8 or 16). %p page number of the image. %q image depth (8 or 16). %s image scene number. %t image filename without any extension. %u a unique temporary filename. %w image width. %x x resolution of the image. %y y resolution of the image.

Set a font with full path and @ in front. e.g. "@/Library/Fonts/Arial.ttf". This way the plugin loads it directly.

See also:

GMImageMBS.attributeValue(name as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Access an arbitrary named image attribute.
Example
Var f as FolderItem = SpecialFolder.Desktop.Child("IMG_4048.jpg")
Var g as new GMImageMBS(f)
Var a as string = g.attributeValue("EXIF:DateTime")
MsgBox a

Any number of named attributes may be attached to the image. For example, the image comment is a named image attribute with the name "comment". EXIF tags are attached to the image as named attributes. Use the syntax "EXIF:<tag>" to request an EXIF tag similar to "EXIF:DateTime":
(Read and Write computed property)

GMImageMBS.attributeValues as dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 17.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A dictionary with all attributes.

As attributes are created on demand, this will only return all so far generated attributes.

GMImageMBS.autoOrient

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Orient image to be right-side up based on its current orientation attribute.

This allows the image to be viewed correctly when the orientation attribute is not available, or is not respected.

GMImageMBS.blur(radius as Double=0.0, sigma as Double=1.0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Blur an image with the specified blur factor.
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.blur(30,10)

Backdrop=image.CopyPicture

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.blurChannel(channel as Integer, radius as Double=0.0, sigma as Double=1.0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Blur an image channel with the specified blur factor.
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.blurChannel(image.BlueChannel, 30,10)

Backdrop=image.CopyPicture

The channel parameter specifies the channel to modify. 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.border

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Border image (add border to image).
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.border

Backdrop=image.CopyPicture

The color of the border is specified by the borderColor attribute.

See also:

GMImageMBS.border(geometry as GMGeometryMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Border image (add border to image).
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.border GMGeometryMBS.Make(10,10)

Backdrop=image.CopyPicture

The color of the border is specified by the borderColor attribute.

See also:

GMImageMBS.cdl(cdl as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 16.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Bake in the ASC-CDL.

Bake in the ASC-CDL, which is a convention for the for the exchange of basic primary color grading information between for the exchange of basic primary color grading information between equipment and software from different manufacturers. It is a useful transform for other purposes as well.

GMImageMBS.channel(channel as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Extract channel from image.

Use this option to extract a particular channel from the image. MatteChannel for example, is useful for extracting the opacity values from an image.

GMImageMBS.channelDepth(channel as Integer) as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
property GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Set or obtain modulus channel depth.

(Read and Write computed property)

GMImageMBS.charcoal(radius as Double=0.0, sigma as Double=1.0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Charcoal effect image (looks like charcoal sketch).
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.charcoal

Backdrop=image.CopyPicture

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.chop(geometry as GMGeometryMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Chop image (remove vertical or horizontal subregion of image).

GMImageMBS.colorHistogram as dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 16.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Calculates histogram.
Example
Var f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
Var g as new GMImageMBS(f)
Var d as Dictionary = g.colorHistogram

MsgBox str(d.Count)+" color"

// check first color
Var c as GMColorMBS = d.key(0)

MsgBox "Color "+str(c.colorValue)+": "+str(d.Value(c))

The dictionary has a GMColorMBS/GMColor16MBS object as key for each color and an unsigned integer as value.

GMImageMBS.colorize(opacity as UInt32, penColor as GMColorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Colorize image with pen color, using specified percent opacity.
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.colorize(10, new GMColorMBS("red"))

Backdrop=image.CopyPicture

See also:

GMImageMBS.colorize(opacityRed as UInt32, opacityGreen as UInt32, opacityBlue as UInt32, penColor as GMColorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Colorize image with pen color, using specified percent opacity for red, green, and blue quantums.
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

image.colorize(10, 0, 5, new GMColorMBS("red"))

Backdrop=image.CopyPicture

See also:

GMImageMBS.colorMap as GMColorMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries array with all colors in color map.

See also:

GMImageMBS.colorMap(index as UInt32) as GMColorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Color at colormap position index.

(Read and Write computed property)

See also:

GMImageMBS.colorMatrix(order as Integer, ColorMatrix() as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 16.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Apply a color matrix to the image channels.
Example
Var f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
Var g as new GMImageMBS(f)

Var m(8) as Double

m(0) = 0.25
m(1) = 0
m(2) = 0.25

m(3) = 0
m(4) = 0
m(5) = 0

m(6) = 0.25
m(7) = 0
m(8) = 0.25

g.colorMatrix 3, m

Backdrop = g.CopyPicture

The user supplied matrix may be of order 1 to 5 (1x1 through 5x5).

GMImageMBS.CombinePictureWithMask as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the image with mask.
Example
Var p as Picture = LogoMBS(500)
Var image as new GMImageMBS(p)

Var c as new GMColorMBS("white")
image.transparent(c)

Backdrop=image.CombinePictureWithMask

Internally this calls Width and Height, CopyPicture and CopyMask.

GMImageMBS.compare(image as GMImageMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compare current image with another image.

Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError in the current image. False is returned if the images are identical. An ErrorOption exception is thrown if the reference image columns, rows, colorspace, or matte differ from the current image:

GMImageMBS.composite(compositeImage as GMImageMBS, gravity as Integer, CompositeOperator as Integer = 2)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compose an image onto another at specified x and y offset and using a specified algorithm.

GMImageMBS.compositeAt(compositeImage as GMImageMBS, offset as GMGeometryMBS, CompositeOperator as Integer = 2)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compose an image onto another at specified x and y offset and using a specified algorithm.

GMImageMBS.compositeXY(compositeImage as GMImageMBS, xOffset as Integer, yOffset as Integer, CompositeOperator as Integer = 2)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compose an image onto another at specified x and y offset and using a specified algorithm.

GMImageMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Default constructor.
Example
// get some image data (e.g. from blob in database)
Var logo as Picture = LogoMBS(500)
Var jpegData as string = PictureToJPEGStringMBS(logo, 80)

// new image
Var mp as new GMImageMBS
Var blob as new GMBlobMBS(jpegData)

// read data from blob into this image object
mp.Read blob

// sometimes you need to explicit convert to RGB/RGBA
'mp.type = mp.TrueColorMatteType
Backdrop=mp.CombinePictureWithMask

See also:

GMImageMBS.Constructor(blob as GMBlobMBS, geometry as GMGeometryMBS, Magick as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Construct Image of specified size, depth, and format from in-memory Blob.
Example
// first open file and read data in blob
SVG_File = FolderItem.ShowOpenFileDialog("")
If SVG_File = Nil Then Return

Var stream as BinaryStream = BinaryStream.Open(SVG_File)
Var data as string = stream.Read(stream.Length)
Var blob as new GMBlobMBS(data)

// 400 width and 400 height
Var geo As New GMGeometryMBS(400, 400, 0, 0)

// pass type here to have GraphicsMagick know it since there is no file name in blob:
Var g as New GMImageMBS(blob, geo, "svg")

See also:

Next items

The items on this page are in the following plugins: MBS GraphicsMagick Plugin.


The biggest plugin in space...