Creating a contact sheet using ImageMagick on OSX

Creating Contact Sheets From Images on OSX

There are probably a million ways to do this. I like this one (mainly because it worked and was painless.)

Install ImageMagick for Mac OS X

Visit http://cactuslab.com/imagemagick and download the second-listed ImageMagick installer. It’s labeled ImageMagick 6.8.7–2 for Mac OS X 10.5 – 10.9 requires XQuartz. If you don’t already have XQuartz installed, you will need that as well. Second, on the same page download and install GhostScript 9.07 for Mac OS X 10.5 – 10.9.

Install this useful bash script

Now that you have ImageMagick up and running, visit this site: http://www.velvetcache.org/2009/03/30/imagemagick-thumbnails-and-contact-sheets https://github.com/jmhobbs/helper-scripts/blob/e0441fe4abd962f5a84cc13fc3954b1bf31279f3/digiCamProc.sh and save out the bash script there as something like “thumbnail.sh”. One way to do that is to copy all of the code from the script and then open a terminal window.

In the terminal window, do cat >thumbnail.sh and hit Enter. You will see a blinking cursor on the screen. Now use cmd-V or similar to paste the text into the open terminal window. Hit ctrl-D to end the copy and this will save everything you pasted into the file thumbnail.sh. Now that you’ve done that, you can change the script to make it so that you can execute it from the terminal command line. Do this: chmod +x ./thumbnail.sh and hit Enter. Now you have an executable “program” in your home directory named thumbnail.sh.

Still in the terminal window, navigate to a folder  with a bunch of image files with file names ending in .jpg by doing something like cd myimages. Type ~/thumbnail.sh and the script will run. It will do two things. First, it will create a folder named “thumb”, which will contain 600×600 pixel thumbnails of your original images. Secondly, it will create a folder called “contact”, which will have a file named 1.jpg, 2.jpg, etc. for each page of contact sheet images. When I ran it, I got 12 images per page.

You can combine these jpg images into a single PDF using an old trick. Select all of the contact sheets, and open them with Preview.app. Click in the thumbnail tray and select all of the images. Then use File > Print and save them as a single PDF.

Gotchas

  1. The script requires that the images be jpeg images and it requires that the filenames end in lower-cased jpg, exactly. Otherwise, it will not find the files and you won’t get the results you expect.
  2. You’re installing some new software on your computer. You should probably visit the ImageMagick site and see what it’s all about. It’s a fantastic (though occasionally frustrating ) suite of image manipulation programs. You should also read the bash script and make sure that you understand what’s it’s doing. If you read the script, you’ll see that there are some choices you can make about the image resizing/resampling algorithm to improve image quality.

Hope this is helpful! This is a great set of tools and I applaud cactus lab for making ImageMagick so easy to install on OSX and I appreciate John Hobbs’s script from his site that makes the magic happen.

Advertisements

2 thoughts on “Creating a contact sheet using ImageMagick on OSX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s