Contact sheet

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
Flaver-D
Posts: 19
Joined: 2015-05-21T12:27:39-07:00
Authentication code: 6789

Contact sheet

Post by Flaver-D »

Hi!
I'm currently trying to make a contact sheet (index print) and I'm not getting what I want.
I'm using ImageMagick 6.9.1-2 Q16 x86 2015-04-14 on Windows 7 starter.
My goal is have something like this Image
With the folder name in one of the top corners and up to 36 images in a grid. And I want it to print on a regular 4x6 print.
So far, this is what I've got

Code: Select all

montage -verbose -units PixelsPerInch -page 462x288 -density 300 -label "%f" -font Arial -pointsize 10 -background "#FFFFFF" -fill "gray" -define jpeg:size=200x200 -geometry 200x200+2+2 -auto-orient *.JPG contact.jpg
but the final image doesn't want to conform to the desired size. I tried setting the -page size to either points (like right now) or pixels but it still doesn't work...

Any help would be greatly appreciated as my coding skills are very limited.
François
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Contact sheet

Post by snibgo »

Your input files are "*.jpg". Your output is also a jpg, in the same directory. So if you re-run your command, the output from the previous run will be included. Better to use different directories, or a different filetype for the output.

Think about pixels instead of inches. How many pixels do you want in the result? If you want 6x4 inches at 300 dpi, this is 1800x1200 pixels. For an array of 6x6 images, each image must fit into a box 300x200 pixels. Perhaps you want a 2-pixel border around each, so each image must fit into 296x196 pixels.

Windows BAT syntax:

Code: Select all

montage ^
  -geometry 296x196^>+2+2 ^
  -tile 6x6 ^
  -density 300 ^
  *.jpg ^
  m2.tiff
snibgo's IM pages: im.snibgo.com
Flaver-D
Posts: 19
Joined: 2015-05-21T12:27:39-07:00
Authentication code: 6789

Re: Contact sheet

Post by Flaver-D »

I started counting pixels yesterday as I figured out that the program is not capable of having the user fix a final image size and fill in the blanks.
I ended up doing this

Code: Select all

montage -verbose -units PixelsPerInch -density 300 ^
-tile 7x6 -label "%f" -font Arial -pointsize 6 -background "#FFFFFF" ^
-fill "black" -define jpeg:size=253x154 -geometry 253x154+2+2 ^
-auto-orient *.JPG -title "My Images" contact.jpg
but the final image size is not always what I want it to be... but at least it's close.
I think I might have to make the image and then use convert to make it the correct size. Am I right?
What's the advantage of using -geometry 296x196^>+2+2 ^ instead of what I used?
François
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Contact sheet

Post by snibgo »

You said you wanted 6x4 inches at 300 dpi, which is 1800x1200 pixels.

My command gives you exactly that.
snibgo's IM pages: im.snibgo.com
Flaver-D
Posts: 19
Joined: 2015-05-21T12:27:39-07:00
Authentication code: 6789

Re: Contact sheet

Post by Flaver-D »

OK, Thanks!
I'll just use it as is and move on to the batch side of things. That's going to be a bit easier as I grew up with the old DOS :)
François
Post Reply