Platforms to show: All Mac Windows Linux Cross-Platform

Back to GM16ImageMBS class.

GM16ImageMBS.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 14.1 ✅ 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.

GM16ImageMBS.addNoise(noise as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ 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 GM16ImageMBS(p)

image.addNoise(image.GaussianNoise)

Backdrop=image.CopyPicture

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

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ 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 GM16ImageMBS(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.

GM16ImageMBS.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 14.1 ✅ 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.

GM16ImageMBS.annotate(text as string, boundingArea as GM16GeometryMBS, gravity as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ 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:

GM16ImageMBS.annotate(text as string, boundingArea as GM16GeometryMBS, gravity as Integer, degrees as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ 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:

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

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

Var g as new GM16ImageMBS(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:

GM16ImageMBS.annotate(text as string, location as GM16GeometryMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ 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:

GM16ImageMBS.attributeValue(name as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ 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 GM16ImageMBS(f)
Var a as string = g.attributeValue("EXIF:DateTime")
MessageBox 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)

GM16ImageMBS.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.

GM16ImageMBS.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.

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


The biggest plugin in space...