Montage a folder

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Shady

Montage a folder

Post by Shady »

Hi,

I am trying to montage a folder with image name randomly between 0-1000. But the montage for the image is not done in a sorted format. Can someone help me with getting a montage in Windows Environment for a complete folder with a random numbers between 0 -1000 in a sorted way. The command I am using

Code: Select all

montage [filename/*.png] -tile 19x21 -geometry +0+0 -auto-orient montage_2.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Montage a folder

Post by fmw42 »

please explain what is not sorted (or what you want sorted) and what you want randomized!

To get random output image numbers, you will need to write a script to loop over your input images, compute a random number using -fx escapes and append that number to your output name. Once that is done, then you should be able to montage them. You may have to use leading zeros in your random numbers in order for your directory to sort them properly.

I am not sure you can provide a wild card for your input images. You may have to list them all or build a list from your loop to feed that list to montage. I am not sure how flexible montage is in this regard.

The other way to do that is to use append to put your images together.
Post Reply