Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a folder full of jpg files. When I use the following command,

convert *.jpg assembly.pdf

I get a pdf file with one image per page of the pdf. I would like to put 9 images on each page. Is there a way to do this with convert or mogrify?

Alternatively, I'd like to combine 9 of the jpg images into one jpg image so that I can convert that into a PDF.

Thanks,

z.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

You're looking for montage from ImageMagick :

NAME
       montage  - create a composite image by combining several sepa‐
       rate images. The images  are  tiled  on  the  composite  image
       optionally adorned with a border, frame, image name, and more.

If you already have convert then you almost certainly also have montage. To get a grid of 3x3 images per page on your pdf try this:

 montage *.jpg -tile 3x3 assembly.pdf

This assumes your images all have roughly the same size. Have a read through the documentation for more complex options.

share|improve this answer
    
This was great! We used montage *.jpg -tile 3x3 -geometry 1000 assembly.pdf to get 9 high quality images per page. We tried it on a sample of 30 images or so, and it worked like a charm! Then we tried to run the full 400 images and... my computer started chirping and seizing, and it consumed 95% of the ram. Eventually we got the message "killed" in the terminal... probably we'll have to run this in batches! :) Anyway, thanks man! I'm going to read the docs in detail, because imagemagick seems like supreme command-line sorcery. –  Ziggy Mar 11 '13 at 5:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.