Page 1 of 1
Montage by file name order?
Posted: 2012-06-21T11:21:51-07:00
by Cutless
I have 649 images that I wish to tile together by their number in a 11x x 59y order. All the images are by a pattern digits (like 1.png, 2.png, 3.png > 647.png, 648.png, 649.png )
I've been trying to fiddle with the options to make them tile in some form of order but learnt that it tiles by column. (I'm using Windows OS Terminal if this makes any difference.)
I was hoping someone could help me sort this out.
Re: Montage by file name order?
Posted: 2012-06-21T11:31:11-07:00
by fmw42
I think you may need to make your image names have leading zeros, such as 001.png .... 999.png so that they are properly alphabetized in your file system. Many systems list 10 after 1.
Re: Montage by file name order?
Posted: 2012-06-21T12:00:21-07:00
by Cutless
Thank you this worked.
I had to make a macro to replace 99 images (good thing I have a g510 keyboard) to add the zeros for me.
I then used the output
Code: Select all
montage -tile 11x59 *.png output.png
To those who may also have the same issue.
Re: Montage by file name order?
Posted: 2012-06-21T18:16:47-07:00
by anthony
Their are a couple of ways.
These are detailed in IM Examples, File Handling, Reading Images
Solutions...
convert image_[0-9].gif image_[1-9][0-9].gif animation.gif
convert image_?.gif image_??.gif image_???.gif animation.gif
convert image_(?|??|???|????).gif animation.gif
convert 'image_%d.gif[0-123]' animation.gif
the later works especially well, and you can specify the format of the digits, but will stop on the first 'missing' image encountered.
NOTE: IM itself will expand the meta-characters '~' '*' and '?' if these are quoted to prevent the shell expanding them. BUt it does not understand the BASH shell '{...}' or '(...)' meta-characters, and '[...]' is used for read modifiers rather than character set expansion.