creating montage of hundreds of images

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
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

creating montage of hundreds of images

Post by manit »

When I give lot of files as input to montage then RAM usage increases & system hangs though I gave -geometry 512x512 option which i believe should make montage handle large files(in MB) with ease because if it takes only 512x512 thumbnail into memory then there should be no space problem.is there any other way through which i can create montage of hundreds of files?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: creating montage of hundreds of images

Post by magick »

Add -limit memory 1mb to your command line to force the pixel processing to disk rather than memory. If you can use wildcards you can try inline resizing like this '*.png[128x128]'.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Thank You avatar

Post by manit »

I found that with option
-limit memory 1mb
the usage of RAM decreased while swap usage increased.Thanks a lot.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

inline resizing is further better BUT

Post by manit »

Do you think that inline resizing means a small image is loaded into memory instead of large one?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: creating montage of hundreds of images

Post by magick »

Assume your average frame size is 1000x1000. With inline resizing, your images are resized as they are read so only the thumbnails are keep in memory or on disk as they are processed. Without inline resizing the original 1000x1000 images are kept in memory or on disk which of course consumes much more resources and is generally slower to process.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: creating montage of hundreds of images

Post by anthony »

If you are reading LOTS of images and plan to make a montage of thumbnails. You best resize the images as they are read in. For example 'image_*.jpg[100x100]'

See IM Examples, Thumbnails
http://www.imagemagick.org/Usage/thumbnails/
read the introductionary areas throughly!

Also see Reading images
http://www.imagemagick.org/Usage/files/#read
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Thank You magick & anthony

Post by manit »

I found that with inline resizing my RAM condumption was meager & on adding swap file usage option it worked better.

TIP FOR ALL
So to all guys who have trouble making montage of hundreds of high resolution images add the option
-limit memory 1mb "file.extension[128x126]"
NOTE here 128x126 is default size of thumbnail which appears in montage.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: creating montage of hundreds of images

Post by anthony »

To stop montage doing its own resizing set geometry without any 'size' option, just the tile spacing options. for example -geometry +10+10

See Montage, Geometry...
http://www.imagemagick.org/Usage/montage/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply