Skip to main content

mosaic images

3 replies [Last post]
Joined: 2009-10-20
Points: 0

I have been experimenting with the image mosaic creator that comes with the cookbook. It seems to work very well and is quick.

Syntax used:


mosaic m1.png
add_image_files {
max_height 1080
max_width 1920


I have a couple of questions:

1) Is there syntax in the mosaic file (not show file), to force the creator to make multiple mosaics from the list of specified files, instead of reporting oversized error?

2) I see the limits are set as 4096 for width and height or 4963776 pixels. Is it better to have 1 image that is near the max size or limit the sizes to 1920*1080 and create several images, which it appears the studio's do?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-02-13
Points: 0

Chihiro's right, that's the intended way to do it.

I thought about having the option you describe, of automatically breaking up a mosaic into multiple images when it gets too big, but I intentionally didn't add that. The theory behind that decision was that if you're making a separate mosaics file, you're probably aware enough of the mosaic file generation so that tuning which images go in which mosaics isn't too much of a burden.

This is different than the case where mosaics get automatically generated from a show file, where it does break things up automatically (im0.png, then im1.png, etc.)

I don't know of any serious measurements on the relative performance of keeping mosaic images down to 1920x1080 or letting them be up near 5M pixels


Joined: 2009-10-20
Points: 0

Thanks guys

Joined: 2006-11-08
Points: 0

Hi there,

Yeah, image mosaics are neat! :-)

As for your questions,

1) You should be able to repeat "mosaic" elements declaration to specify multiple mosaic png file. Our xlet/grin_samples/GrinBunny sample seems to have a simple standalone mosaic file, grinbunny_mosaics.txt.

2) I believe how you want to structure the mosaic largely depends on how your app is using the images in the mosaic; the physical size of the mosaic image is secondary. It's faster to load one large mosaic image compared to many small ones. At the same time, the mosaic image will not be unloaded and keep on occupying the box's precious memory until all the images in that mosaic is unreferenced. So it's wise to have images that are getting displayed together on the screen to be in the same mosaic, but use different mosaics for images that doesn't need to be loaded together.