Platforms to show: All Mac Windows Linux Cross-Platform

Back to GM16ImageMBS class.

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

GM16ImageMBS.channel(channel as Integer)

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

GM16ImageMBS.channelDepth(channel as Integer) as UInt32

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

(Read and Write computed property)

GM16ImageMBS.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 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Charcoal effect image (looks like charcoal sketch).
Example
Var p as Picture = LogoMBS(500)
Var image as new GM16ImageMBS(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.

GM16ImageMBS.chop(geometry as GM16GeometryMBS)

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

GM16ImageMBS.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 GM16ImageMBS(f)
Var d as Dictionary = g.colorHistogram

MsgBox str(d.Count)+" color"

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

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

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

GM16ImageMBS.colorize(opacity as UInt32, penColor as GM16ColorMBS)

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

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

Backdrop=image.CopyPicture

See also:

GM16ImageMBS.colorize(opacityRed as UInt32, opacityGreen as UInt32, opacityBlue as UInt32, penColor as GM16ColorMBS)

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

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

Backdrop=image.CopyPicture

See also:

GM16ImageMBS.colorMap as GM16ColorMBS()

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:

GM16ImageMBS.colorMap(index as UInt32) as GM16ColorMBS

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

(Read and Write computed property)

See also:

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

GM16ImageMBS.CombinePictureWithMask as picture

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

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

Backdrop=image.CombinePictureWithMask

Internally this calls Width and Height, CopyPicture and CopyMask.

GM16ImageMBS.compare(image as GM16ImageMBS) as boolean

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

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

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

GM16ImageMBS.compositeAt(compositeImage as GM16ImageMBS, offset as GM16GeometryMBS, CompositeOperator as Integer = 2)

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

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

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

GM16ImageMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ 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 GM16ImageMBS
Var blob as new GM16BlobMBS(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:

GM16ImageMBS.Constructor(blob as GM16BlobMBS, geometry as GM16GeometryMBS, Magick as string)

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

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

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

See also:

GM16ImageMBS.Constructor(size as GM16GeometryMBS, ColorValue as GM16ColorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Construct a blank image canvas of specified size and color.
Example
Var g as new GM16GeometryMBS(600,600)
Var c as new GM16ColorRGBMBS(1.0,0.0,0.0) // red
Var image as new GM16ImageMBS(g, c)

const TrueColorType=6

// Ensure that there are no other references to this image.
image.modifyImage
// Set the image type to TrueColor DirectClass representation.
image.type=TrueColorType

Backdrop=image.CopyPicture(0,0,600,600)

See also:

GM16ImageMBS.Constructor(width as UInt32, height as UInt32, map as string, StorageType as Integer, data as ptr)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Initializes single image frame from an array of raw pixels, with specified storage type (ConstituteImage).
Example
Var data as new memoryblock(2048*2048) // your data
Var image as new GM16ImageMBS(2048, 2048, "I", GM16ImageMBS.StorageTypeCharPixel, data)

Returns an Image corresponding to an image stored in a raw memory array format. The pixel data must be in scanline order top-to-bottom. The data can be unsigned char, unsigned short int, unsigned int, unsigned long, float, or double. Float and double require the pixels to be normalized to the range [0..1], otherwise the range is [0..MaxVal] where MaxVal is the maximum possible value for that type.

Note that for most 32-bit architectures the size of an unsigned long is the same as unsigned int, but for 64-bit architectures observing the LP64 standard, an unsigned long is 64 bits, while an unsigned int remains 32 bits. This should be considered when deciding if the data should be described as "Integer" or "Long".

For example, to create a 640x480 image from unsigned red-green-blue character data, use

image = new GM16ImageMBS(640, 480, "RGB", GM16ImageMBS.StorageTypeCharPixel, pixels);

width: width in pixels of the image.
height: height in pixels of the image.
map: This string reflects the expected ordering of the pixel array. It can be any combination or order of R = red, G = green, B = blue, A = alpha (same as Transparency), O = Opacity, T = Transparency, C = cyan, Y = yellow, M = magenta, K = black, or I = intensity (for grayscale). Specify "P" = pad, to skip over a quantum which is intentionally ignored. Creation of an alpha channel for CMYK images is currently not supported.
type: Define the data type of the pixels. Float and double types are expected to be normalized [0..1] otherwise [0..MaxRGB]. Choose from these types: StorageTypeCharPixel, StorageTypeShortPixel, StorageTypeIntegerPixel, StorageTypeLongPixel, StorageTypeFloatPixel, or StorageTypeDoublePixel.
pixels: This array of values contain the pixel components as defined by map and type. You must preallocate this array where the expected length varies depending on the values of width, height, map, and type.

See also:

GM16ImageMBS.contrast(sharpen as UInt32)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Contrast image (enhance intensity differences in image).
Example
Var p as Picture = LogoMBS(500)
Var image as new GM16ImageMBS(p)

image.contrast(10)

Backdrop=image.CopyPicture

GM16ImageMBS.convolve(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
Convolve image.
Example
Var f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
Var g as new GM16ImageMBS(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.convolve 3, m

Backdrop = g.CopyPicture

Applies a user-specified convolution to the image.
order represents the number of columns and rows in the filter kernel.
kernel is an array of doubles representing the convolution kernel.

GM16ImageMBS.CopyPicture as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the image and returns it as a new picture.
Example
Var g as new GM16GeometryMBS(500,500)
Var c as new GM16ColorRGBMBS("white") // white
Var image as new GM16ImageMBS(g, c)

image.strokeColor = new GM16ColorRGBMBS("red") // Outline color
image.fillColor = new GM16ColorRGBMBS("green") // Fill color
image.strokeWidth = 5

Var draw as GM16GraphicsMBS = image.Graphics

// Draw a circle
draw.Rectangle(250, 250, 100, 100)

Backdrop=image.CopyPicture

You may need to set image type to RGB to get it working.

See also:

GM16ImageMBS.CopyPicture(x as Integer, y as Integer, width as Integer, height as Integer) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the image and returns it as a new picture.
Example
Var p as Picture = LogoMBS(500)
Var image as new GM16ImageMBS(p)

image.threshold 127

// convert to RGB so CopyPicture works
image.type = image.TrueColorType
Backdrop=image.CopyPicture(0,0,250,250)

You may need to set image type to RGB to get it working.

See also:

GM16ImageMBS.CopyPictureMask as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the image's mask and returns it as a new picture.
Example
Var f As FolderItem = SpecialFolder.Desktop.Child("test.png")
Var g As New GM16ImageMBS(f)

// get image with mask
Var p As picture = g.CopyPicture
p.mask = g.CopyPictureMask

window1.Backdrop = p

See also:

GM16ImageMBS.CopyPictureMask(x as Integer, y as Integer, width as Integer, height as Integer) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the image's mask and returns it as a new picture.

See also:

GM16ImageMBS.CopyPixelsMemory as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copy the pixels as they are into a memoryblock.

Optional specify rectangle.
Returns nil on low memory or bad parameter. Image must be of type class direct (not palette picture).
Order of pixel data is normally Red, Green, Blue, Opacity. Or Cyan, Magenta, Yellow, Black for CMYK images.
For GM16ImageMBS, the data is 8bit per channel. For GMImage16MBS, the data is 16bit per channel.

See also:

GM16ImageMBS.CopyPixelsMemory(x as Integer, y as Integer, width as Integer, height as Integer) as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copy the pixels as they are into a memoryblock.

Optional specify rectangle.
Returns nil on low memory or bad parameter. Image must be of type class direct (not palette picture).
Order of pixel data is normally Red, Green, Blue, Opacity. Or Cyan, Magenta, Yellow, Black for CMYK images.
For GM16ImageMBS, the data is 8bit per channel. For GMImage16MBS, the data is 16bit per channel.

See also:

GM16ImageMBS.CreateHBITMAP as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 15.1 ❌ No ✅ Yes ❌ No ❌ No All
Creates a HBITMAP for the image for use with Windows Declares.
Example
// get test image
Var logo as Picture = LogoMBS(500)

// create GraphicsMagick image
Var g as new GM16ImageMBS(logo)

// make a HBitmap
Var hBitmap as ptr = g.CreateHBITMAP

// convert back to Xojo picture
Var pic as Picture = WindowsBitmapMBS.HBitmapToPicture(hBitmap, true)

// show in window
Backdrop = pic

// and cleanup memory
WindowsBitmapMBS.DeleteBitmap(hBitmap)

The HBITMAP returned needs to be freed when you are done with it or you risk having a memory leak.

GM16ImageMBS.crop(geometry as GM16GeometryMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Crop image (return subregion of original image).
Example
Var p as Picture = LogoMBS(500)
Var image as new GM16ImageMBS(p)

image.crop GM16GeometryMBS.Make(100,200)

Backdrop=image.CopyPicture

GM16ImageMBS.cycleColormap(amount as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Cycle (rotate) image colormap.
Example
Var p as Picture = LogoMBS(500)
Var image as new GM16ImageMBS(p)

image.cycleColormap(5)

image.type = image.TrueColorType

Backdrop=image.CopyPicture

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


The biggest plugin in space...