how can i improve montage performance for huge montage

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
mstanescu

how can i improve montage performance for huge montage

Post by mstanescu »

I have something like 12000 jpegs of 256x256 and i want to montage them in a 150x75 tile configuration.

The thing goes very very slow. When i run montage with -verbose things go really fast like 500 images in first 2 seconds then starts to drop....after about 600 images the performance is about 1 image per second...i cannot actually extrapolate for 12000 but i think ill reach end of universe until my picture is stitched...just kidding :)

My command line is
montage -verbose -geometry +0+0 -tile 156x78 *.jpg ../result.jpg


Any tips and tricks ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: how can i improve montage performance for huge montage

Post by magick »

Try this command:
  • montage -verbose -size 120x120 -geometry 120x120+0+0 -tile 156x78 *.jpg ../result.jpg
mstanescu

Re: how can i improve montage performance for huge montage

Post by mstanescu »

magick wrote:Try this command:
  • montage -verbose -size 120x120 -geometry 120x120+0+0 -tile 156x78 *.jpg ../result.jpg
I tried it ..same result. I tried
montage -verbose -size 39936x19968 -geometry 256x256+0+0 -tile 156x78 *.jpg ../result.jpg
montage -verbose -size 256x256 -geometry 256x256+0+0 -tile 156x78 *.jpg ../result.jpg

no difference

This is a 2G ram machine but i watched the memory during run but i see no swapping

total used free shared buffers cached
Mem: 1994056 969792 1024264 0 28392 465904
-/+ buffers/cache: 475496 1518560
Swap: 4008208 180204 3828004
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: how can i improve montage performance for huge montage

Post by magick »

Are you using ImageMagick 6.5.6-1? If so you need -define jpeg:size=128x128. If not you can get some improvement if you use the Q8 version of ImageMagick instead of the default Q16. Otherwise, the montage command will complete it just may take several hours. One last option is to build the montage yourself. Create an image canvas and composite one image row at a time.
mstanescu

Re: how can i improve montage performance for huge montage

Post by mstanescu »

magick wrote: Create an image canvas and composite one image row at a time.
I did that eventually
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how can i improve montage performance for huge montage

Post by fmw42 »

try append, it should be easier that composite.

see http://www.imagemagick.org/script/comma ... php#append
Post Reply