Montage seems slow

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
Posts: 11
Joined: 2019-02-10T00:32:33-07:00
Authentication code: 1152

Montage seems slow

Post by gialandra » 2019-02-10T01:10:53-07:00

I use montage to create a composite image starting from about 1700 256x256 pixel 24 bit PNG images. My PC is a i7 + 16 GB RAM + SSD. It works like a charm but seems slow. Is there something to get the operations faster?

I use this command: magick montage -tile 37x -geometry +0+0 "C:\Users\...\2*.png" "C:\Users\...\2.png"

C:\Users\MN\Downloads>magick montage --version
Version: ImageMagick 7.0.8-24 Q16 x64 2019-01-17
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib

Posts: 11687
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage seems slow

Post by snibgo » 2019-02-10T04:27:23-07:00

Your output filename is included in your input filename, so if you run the command twice, the previous output will be one of the inputs.
wrote:It works like a charm but seems slow. Is there something to get the operations faster?
How slow is "slow"? The command does a load of work, so will take some time. A system tool (such as taskmgr in Windows) can tell you cpu, memory and disk resources used, and hence whether a bottleneck might be removed.

Check the command doesn't create temporary files when it runs.

PNG isn't the fastest format in the world, especially if your images are photos.
snibgo's IM pages:

User avatar
Site Admin
Posts: 10980
Joined: 2003-05-31T11:32:55-07:00

Re: Montage seems slow

Post by magick » 2019-02-10T06:28:12-07:00

ImageMagick allocates a number of your images in memory until memory is exhausted and then places the rest on your SSD. Since memory is nearly exhausted, subsequent memory request likely spikes swapping to disk. Instead, push all images to SSD, reducing swapping. Assume your SSD is f:/tmp, try this command:

Code: Select all

montage -define registry:temporary-path="f:/tmp" -limit area 0 -tile 37x -geometry +0+0 "C:\Users\...\2*.png" "C:\Users\...\2.png"

Post Reply