Page 1 of 1

Montage with numbered tiles

Posted: 2011-05-17T07:43:29-07:00
by dirk
Hi,

I would like to number the tiles in an image created with 'montage' so that the first tile (=file) gets the number 1, the second the number 2, and so on..

My command at the moment looks like this:

Code: Select all

montage -label '???' *.png -tile 20x5 -geometry 300x1800 -debug cache montage20x5.jpg
Thanks for help,

Dirk

Re: Montage with numbered tiles

Posted: 2011-05-17T09:33:20-07:00
by fmw42
You have to use -set label after the input images. This works:

montage zelda3.png lena2.png -set label '%[fx:t+1]' tmp.png

see fx where t = scene number of current image in sequence (starts with 0)

http://www.imagemagick.org/Usage/montage/#label
http://www.imagemagick.org/script/fx.php
http://www.imagemagick.org/Usage/transform/#fx_escapes

Re: Montage with numbered tiles

Posted: 2011-05-17T15:47:00-07:00
by anthony
WARNING this will however only work with the latest versions of IM where the '%[fx:t]' and the '%t' settings have been fixed.
Hmmm from IM v6.6.8-6 onward. Before this you would only get a value of zero, and not the current image index.

As you can see you can use the index as part of a mathematical expression using FX :-)

Re: Montage with numbered tiles

Posted: 2011-05-18T05:42:15-07:00
by dirk
Great, this works.

For my example, the command for indexing with 'montage' looks as follows:

Code: Select all

montage -set label '%[fx:t+1]' *.png -tile 20x5 -geometry 300x1800 -debug cache montage20x5.jpg
Thanks,

Dirk

Re: Montage with numbered tiles

Posted: 2011-05-18T16:56:48-07:00
by anthony
The -set works with actual images. Put it AFTER reading in the images. This may error in the future!