Page 1 of 1

Place 8000 image on an landscape A2 page

Posted: 2015-07-27T08:31:05-07:00
by mikewilsonuk
Hi, I want to place 8000 images on an A2 landscape page equally spaced (same border around images) to form a grid. I've played around with ImageMagick but can't get close to getting this to work. The original individual images are in 16:9 ratio (1280x720 pixels).

Thanks for any help,

Mike

Re: Place 8000 image on an landscape A2 page

Posted: 2015-07-27T10:02:25-07:00
by fmw42
Use montage. But be sure you have enough memory to hold all the images. The other approach is to write a script to loop over the images and process them one row and a time using +append and then append all the rows using -append. You will need to use -border to add your border around each image if using append. Montage will add borders automatically.

See also http://www.imagemagick.org/Usage/files/#massive and viewtopic.php?f=4&t=26801

Please always identify your version of IM and platform.

Re: Place 8000 image on an landscape A2 page

Posted: 2015-07-28T21:31:53-07:00
by snibgo
A2 paper is 594x420mm. With 8000 images, each one will occupy 31 square mm, or about 1/4 inch square. If your printer is 600 dpi, each image will be about 150x150 pixels. The total image would be about 14,000x10,000 pixels, which isn't horribly large.

The best way is probably to shrink all the images first. Then they can probably be montaged together without causing memory problems.

Re: Place 8000 image on an landscape A2 page

Posted: 2015-07-28T22:14:27-07:00
by fmw42
User snibgo has a good point about resizing the images first.

Since your images are large, it is probably better to use mogrify first to do the resizing to a new folder, then cd to that new folder and run montage on the resized images.

see
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/montage/

It is always a good idea to provide your IM version and platform when asking questions, because syntax and especially scripting can be different.

Re: Place 8000 image on an landscape A2 page

Posted: 2015-07-28T22:28:22-07:00
by snibgo
As proof of concept, I create 8000 png files and montage them:

Code: Select all

%IM%convert -size 150x150 xc:red -duplicate 7999 i_%%06d.png

%IM%montage i_*.png -tile 100x t.png

%IM%identify t.png

t.png PNG 12800x10080 12800x10080+0+0 8-bit sRGB 2c 50KB 0.000u 0:00.000
The montage took 24 seconds on my laptop, peaking at 3.6 GB of memory.