Page 1 of 1

montage - pack images

Posted: 2008-05-12T09:45:44-07:00
by stuaxo
Hi,
It'd be really useful for j2me development if montage had two things:
1. pack mode
Pack images in as tightly as possible
1b pack mode with overlap (if it is safe, overlap the images i.e. if two images have a line of white pixels at the start and end).

2. output the filename, x, y, width, height for each file placed in the new image.

With this it would be a very useful tool :)

Cheers.

Re: montage - pack images

Posted: 2008-05-12T10:33:49-07:00
by magick
The closest we have to pack is -mode concatenate.

Add -verbose to your command line to list the image file names and their offsets. You can also use this command:
  • identify -verbose montage.miff

Re: montage - pack images

Posted: 2008-05-12T11:23:25-07:00
by fmw42
I found that you can overlap images, if somewhat tricky, by using negative offsets for the -geometry parameter.

See another recent post:

viewtopic.php?f=1&t=11176

Re: montage - pack images

Posted: 2008-05-19T04:12:32-07:00
by stuaxo
Hm, yes I tried concatenate, but when the images are different sizes big gaps appear negating any size benefits.

For the moment, I'm looking at just using montage on groups of images the same size.

Just tried verbose, and it doesn't give pixel coordinates of the images; I assume their added left-to-right, top-to-bottom.

Is there anywhere I could post an RFE for the packing? I'm looking at integrating this into a build environment, so the idea is to not have to manually adjust images geometry etc.

(Or does anyone know of some other tool that could do this?)

Re: montage - pack images

Posted: 2008-05-19T04:19:12-07:00
by stuaxo
Update: Found this python image packer which I'm having a look at
http://aspn.activestate.com/ASPN/Cookbo ... ipe/442299

Update2: This doesn't do the efficient packing I need :(

Re: montage - pack images

Posted: 2008-05-20T08:45:44-07:00
by stuaxo
magick wrote:The closest we have to pack is -mode concatenate.

Add -verbose to your command line to list the image file names and their offsets. You can also use this command:
  • identify -verbose montage.miff
By offsets I really meant placement - is there no way to see where it's put the files, or do I have to calculate it myself ?

Heres some output I get:

montage -verbose -mode concatenate offline.png online.png ../tmp/grid_12x12.png
offline.png PNG 12x12 12x12+0+0 8-bit DirectClass 636b
online.png PNG 12x12 12x12+0+0 8-bit DirectClass 646b