Home > other >  Create a montage of 15000 images
Create a montage of 15000 images

Time:01-28

I am trying to create a collage/montage of 15000 images using imagemagick montage command.The tool works perfectly for a small subset of the images but when trying to create a montage using 15K images the program crashes because it can't just load 15K images into main memory. I think opening the files in streams and then stacking in batches of 100 would work but if someone has a nice solution,it would be helpful.

CodePudding user response:

It's a bit late here to write and test anything, but I'd probably do something like this:

  • generate a text file with all the filenames to montage
  • use split command to break that into groups of 100
  • iterate over all the groups making a row of images from each
  • stack the rows

First part is like:

find . -name "*.jpg" -print > filelist.txt

Next part is like:

split -l 100 filelist.txt ROWS

Next part is like:

n=0
for f in ROWS* ; do
    magick @"$f"  append row${n}.jpg
    ((n=n 1))
done

Last part is like:

magick row*.jpg -append result.jpg
  •  Tags:  
  • Related