Platforms to show: All Mac Windows Linux Cross-Platform

Back to GMImageArrayMBS class.

GMImageArrayMBS.animateImages

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Animate a sequence of image frames.

Image frames are displayed in succession, creating an animated effect. The animation options are taken from the first image frame. This feature is only supported under X11 at the moment.

GMImageArrayMBS.append(image as GMImageMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds an image to the end of the array.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// put copy of first image on the back
dim n as GMImageMBS = g.FirstImage
g.append n

// write to file

dim output as FolderItem = SpecialFolder.Desktop.Child("output.gif")

g.writeImages(output.NativePath)

Instead of gif, you can also use tif files.

GMImageArrayMBS.appendImages(stack as boolean = false) as GMImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Append a sequence of image frames, writing the result to new image.

All the input image frames must have the same width or height. Image frames of the same width are stacked top-to-bottom. Image frames of the same height are stacked left-to-right. If the stack parameter is false, rectangular image frames are stacked left-to-right otherwise top-to-bottom.

GMImageArrayMBS.averageImages as GMImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Average a sequence of image frames, writing the result to averagedImage.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// averageImages
dim n as GMImageMBS = g.averageImages
Backdrop = n.CopyPicture

All the input image frames must be the same size in pixels.

GMImageArrayMBS.coalesceImages as GMImageArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Create a coalesced image sequence obtained by "playing" the image sequence (observing page offsets and disposal methods) to create a new image sequence in which all frames are full size and completely rendered.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// deconstruct
g = g.coalesceImages

// write gif
dim output as FolderItem = SpecialFolder.Desktop.Child("output.gif")
g.writeImages output.NativePath

Note that if the original image sequence relied on page offsets and disposal methods that the resulting sequence will be larger (perhaps much larger) then the original. This is useful for GIF animation sequences that have page offsets and disposal methods. The resuting image sequence is returned.

GMImageArrayMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates an empty image array.

GMImageArrayMBS.deconstructImages as GMImageArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Break down an image sequence into constituent parts.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// deconstruct
g = g.deconstructImages

// write gif
dim output as FolderItem = SpecialFolder.Desktop.Child("output.gif")
g.writeImages output.NativePath

This is useful for creating GIF or MNG animation sequences.

GMImageArrayMBS.displayImages

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Display a sequence of image frames.

Through use of a pop-up menu, image frames may be selected in succession. This feature is fully supported under X11 but may have only limited support in other environments.
Caution: if an image format is is not compatable with the display visual (e.g. JPEG on a colormapped display) then the original image will be altered. Use a copy of the original if this is a problem.

display methods are not supported currently.

GMImageArrayMBS.FirstImage as GMImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns first image in array.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// show first image
dim img as GMImageMBS = g.FirstImage

// convert to true color for CopyPicture to work
const TrueColorType=6
img.type=TrueColorType

Backdrop = img.CopyPicture

GMImageArrayMBS.flattenImages as GMImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Merge a sequence of image frames which represent image layers into a single composited representation.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// put copy of first image on the back
dim n as GMImageMBS = g.flattenImages

Backdrop = n.CopyPicture

Returns the flattened image. This function is useful for combining Photoshop layers into a single image.

GMImageArrayMBS.Image(index as Integer) as GMImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries image with given index.

GMImageArrayMBS.insert(image as GMImageMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts an image on the front.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// put copy of first image on the front
dim n as GMImageMBS = g.FirstImage
g.insert n

// write to file

dim output as FolderItem = SpecialFolder.Desktop.Child("output.gif")

g.writeImages(output.NativePath)

GMImageArrayMBS.LastImage as GMImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns last image in array.

GMImageArrayMBS.mapImages(map as GMImageMBS, dither as boolean = true, measureError as boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replace the colors of a sequence of images with the closest color from a reference image.

Set dither to true to enable dithering. Set measureError to true in order to evaluate quantization error.

GMImageArrayMBS.montageImages(options as GMMontageMBS) as GMImageArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Create a composite image by combining several separate image frames.
Example
// build montage
dim StackingMontage as New GM16MontageMBS
StackingMontage.backgroundColor = New GM16ColorMBS(&cE7E7E7)
StackingMontage.fillColor = New GM16ColorMBS(&c000000)
StackingMontage.tile = New GM16GeometryMBS("1x20")
StackingMontage.geometry = New GM16GeometryMBS("160x120+5+5")
StackingMontage.font = "Helvetica"
StackingMontage.pointSize = 12
StackingMontage.title = "Title goes here"

// make picture
dim logo as Picture = LogoMBS(500)
dim image as New GM16ImageMBS(logo)

image.label("Sample label")

// Put the current image into the array
Dim StackingFrames As new GM16ImageArrayMBS
StackingFrames.insert(image)

// show result
dim resultImages as GM16ImageArrayMBS = StackingFrames.montageImages(StackingMontage)
Backdrop = resultImages.Image(0).CopyPicture

Multiple frames may be generated in the output array depending on the tile setting and the number of image frames montaged. Montage options are provided via the parameter options. Options set in the first image frame (backgroundColor, borderColor, matteColor, fillColor, strokeColor, font and fontPointsize) are also used as options by montageImages().

GMImageArrayMBS.morphImages(frames as Integer) as GMImageArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Morph a seqence of image frames.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// coalesce to make sure we have full images
g = g.coalesceImages
// morph to 10 pictures
g = g.morphImages(10)

// write gif
dim output as FolderItem = SpecialFolder.Desktop.Child("output.gif")
g.writeImages output.NativePath

This algorithm expands the number of image frames (output to the new image array) by adding the number of intervening frames specified by frames such that the original frames morph (blend) into each other when played as an animation.

GMImageArrayMBS.mosaicImages as GMImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inlay a number of images to form a single coherent picture.

The result image argument is updated with a mosaic constructed from the image sequence.

GMImageArrayMBS.quantizeImages(measureError as boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Quantize colors in images using current quantization settings.

Set measureError to true in order to measure quantization error.

GMImageArrayMBS.readImages(blob as GMBlobMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Read a sequence of image frames into existing container (appending to array) from blob.

See also:

GMImageArrayMBS.readImages(imageSpec as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Read a sequence of image frames into existing container (appending to array) with image names specified in the string imageSpec.

See also:

GMImageArrayMBS.remove(index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes the image with the given index.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// remove first
g.remove 0

// write to file

dim output as FolderItem = SpecialFolder.Desktop.Child("output.gif")

g.writeImages(output.NativePath)

Index should be between 0 and size-1.

GMImageArrayMBS.reverse

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reverses the order of images in the array.

GMImageArrayMBS.writeImages(blob as GMBlobMBS, adjoin as boolean = true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Writes images to the given blob object.

Write images in container to in-memory BLOB specified by Blob blob. Set adjoin to false to write a set of image frames via a wildcard imageSpec (e.g. image%02d.miff).
Caution: if an image format is selected which is capable of supporting fewer colors than the original image or quantization has been requested, the original image will be quantized to fewer colors. Use a copy of the original if this is a problem.

See also:

GMImageArrayMBS.writeImages(imageSpec as string, adjoin as boolean = true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Writes images to the given path.
Example
// read gif
dim g as new GMImageArrayMBS
dim file as FolderItem = SpecialFolder.Desktop.Child("test.gif")
g.readImages(file.NativePath)

// write to file

dim output as FolderItem = SpecialFolder.Desktop.Child("output.gif")

g.writeImages(output.NativePath)

Write images in container to file specified by string imageSpec. Set adjoin_ to false to write a set of image frames via a wildcard imageSpec (e.g. image%02d.miff).
The wildcard must be one of %0Nd, %0No, or %0Nx.
Caution: if an image format is selected which is capable of supporting fewer colors than the original image or quantization has been requested, the original image will be quantized to fewer colors. Use a copy of the original if this is a problem.

See also:

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


The biggest plugin in space...