Is anyone familiar with using the GraphicsMagick libraries (via the MBS plugins)? I am trying to figure out how to make a single column montage from an image array and the documentation is (ahem) a bit lacking. It’s not necessarily Christian’s fault, the documentation on the GM website is just as bad. All the examples that I’ve found assume that you’re doing things via the command line, and trying to translate the parameters into the requisite GM16MontageMBS, and GM16GeometryMBS classes is a nightmare, especially when what sound like the necessary properties don’t accept the types of values that make any sense.
If anyone has already done the legwork and figured this out I would be forever grateful if I could pick your brain.
Cheers.
-bill k
I havent used it, but I believe the method is:
1/Create an array of images GMIMAGEARRAYMBS
https://www.monkeybreadsoftware.net/class-gmimagearraymbs.shtml
2/ Create and set properties of the GMMontageMBS object
https://www.monkeybreadsoftware.net/class-gmmontagembs.shtml
I suspect that the row/column must be a function of the image width and the thumbnail width
gmgeo = new GMGeometryMBS(48,480) should force a 1 x 10 matrix of 48 pixel thumbs with no border ?
The result is a file named <GMMontageMBS.fileName> but if the images exceed the space allowed, you can specify a wildcard name to get several images
For example, a filename specification of image%02d.miff names the montage images as image00.miff, image01.miff, etc.
I assume you want a disc image at the end of this?
If it is for screen display, you may be better off just adding a listbox to the screen and displaying a thumbnail image on each row on demand.
Thanks Jeff for the response. I’m using this feature to display a column of thumbnails in a scrolling canvas to the right of a “stacked” image, so nothing is getting read from or written to disk. I’ve got it figured out (for the most part), but still can get the thumbnail labels to appear. It turns out that the only class constructor methods that work correctly are the ones where you specify options using strings. Any other way results in a black background.
Here’s my code and a screenshot of what it’s producing:
Dim StackingMontage as GM16MontageMBS
Dim StackingFrames As GM16ImageArrayMBS
The StackingMontage class gets created when the application is opened:
StackingMontage = New GM16MontageMBS
StackingMontage.geometry = New GM16GeometryMBS("160x120+5+5") <---- This is what the command line parameters would look like, amazingly it works just fine here
StackingMontage.tile = New GM16GeometryMBS("1x20") <---- There's no mention of tiling rows/columns in the documentation, again this works just fine (the maximum number of exposures that can be expected to stack is 20)
StackingMontage.backgroundColor = New GM16ColorMBS("#E7E7E7") <---This works
'StackingMontage.backgroundColor = New GM16ColorMBS(&cE7E7E7) <---This doesn't work (results in a black background)
StackingMontage.penColor = New GM16ColorMBS("#7F7F7F") <----- Using the "string" type parameter again for the constructor
StackingMontage.pointSize = 10 <---- I assume that we're taking standard point sized, 10 sounds reasonable
StackingMontage.label = "%g" <---- This *should* at least display the geometry information
This is the [simplified] code that get's run when each exposure (Frame) is taken:
Dim image As GM16ImageMBS
Dim thumbs As Picture
image = New GM16ImageMBS(Frame)
image.label(CStr(IntegrationLength) + "s")
StackingFrames.insert(image)
thumbs = StackingFrames.montageImages(StackingMontage).Image(0).CopyPicture
cvsStackingThumbs.Height = thumbs.Height
cvsStackingThumbs.Width = thumbs.Width
cvsStackingThumbs.Backdrop = thumbs

So I still can’t figure out why none of the labels are getting displayed in the montage. Neither the geometry information (as specified in the montage specification), nor the custom label that I assign to the images are displaying (as you can see).
Has anyone else used this plugin? If not I’ll keep working on it…
Cheers.
-bill k
I’ll fixed the GM16ColorMBS constructor taking color for 16-bit.
Amazing what you guys do. I can’t help much.
PS: When no text shows, did you check if you specified a font?
I haven’t specified a font. I’ll try that and will let you know. I’m not sure what that will look like (“System”, “Helvetica”, ?), it seems like GM is happier with X11 type nomenclature. Command line examples (on the graphicsmagick.org website) are few and far between and programming examples are nonexistent.
Forgive me: I cant help feeling that the listbox method would have been easier… 
Just add 20 rows, set the row height, and draw one image plus a label in the cellbackgroundPaint event.
Doesnt even need a plugin…
Did you actually need a tall image montage, or is this just for the screen display as your screenshot?
Jeff, I’m using the GraphicsMagick libraries for a bunch of other image manipulation capabilities (not just this) since they can do 16-bit calculations rather than the normal 8-bit ones that you’re limited to when dealing with standard Xojo Picture objects. The individual images only exist as GMImageMBS classes (not as standard pictures) until the very end when the result finally get’s drawn to the preview window. It just so happened that the library has this “montaging” capability and I figured that I’d make use of it.
In older versions of the software I used regular pictures and did all this manually, adding and removing picture objects, canvasses and labels for each thumbnail, and positioning and scrolling them correctly on the container. This way requires is just a single, variable height canvas that I scroll. I was able to get rid of a ton of code. Using a listbox is a cool idea, but I think that the constant conversion back to scaled picture objects in the cell paint event would seriously tax a slower computer.
I’ll keep plugging away…
Ah… 
Hmm…
If its just for a scrolling listbox from which to choose an image to display at full size, you could keep your 16bit suff, but mirror the 20-element 16bit image array with a 20-element pre-created thumbnail array and display those thumbnails in the paint events.
No lag at all: dont keep converting, just do it once.