pythonimage-processingimagemagickimagemagick-montage

Create a montage of 15000 images


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.


Solution

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


    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