Rolling Windows and Sticky Bytes

<tagline type="clever"/>

Painless Thumbnail Creation

on 2012-12-30

I recently had a need to create thumbnails and discovered that using off the shelf photo management software to generate thumbnails is not very practical since these applications tend to try to preserve the quality of the image regardless how small you make the image itself. The end result of my first attempt was a set of images that were 150px on their longest edge and still over 30KB each. For a thumbnail, that’s an awfully large file.

My wife has a copy of Photoshop so I fired that up and created an action to create a 150px thumbnail from an arbitrary image and used Photoshop automation to thumbnail them all in a batch. Here’s the rough process I followed:

  1. Make a copy of the images you want to thumbnail, just in case. Make a second backup and store it somewhere safe, just in case.
  2. Start up Photoshop and open up one of the images.
  3. Bring up the Actions panel if you don’t already have it open. Create a new action — it should start recording automatically.
  4. To size your image down, you’ll want to use the image fitter instead of the resize function. This is particularly important if you have a mix of portrait and landscape images since the resize function will only resize one dimension. If you resize a portrait image to 150px width, the height will be larger than 150px which is probably not what you want. To use the image fitter, select File => Automate => Fit Image. Set both dimensions to the desired longest edge (in my case, this was 150px) and click OK.
  5. Select File => Save for Web… and choose appropriate settings (I used JPEG High which gave me a thumbnail size of ~7.5KB with minimal quality loss). Save your thumbnail to a new location.
  6. Close the file. This is important because it keeps your action from opening up hundreds of files and leaving them open if you use it in Batch mode.
  7. Stop the action. You should now have an action you can use to generate one thumbnail.
  8. Finally, once you have your action set up, you can run it in Batch mode by selecting File => Automate => Batch… to run it against multiple files. Select the source directory and target directory. Make sure these are different or you may accidentally overwrite your originals (you made a backup… right?). In the Batch options, be sure to check the Override Action “Save As” Commands checkbox. The name is somewhat misleading — checking this checkbox prevents Photoshop from popping up the JPEG Options dialog and overwriting your tiny thumbnail file with a large one as part of the batch. If you leave this checkbox unchecked, the JPEG Options dialog will open for every image and your thumbnail will be overwritten with a larger file during the action.

The thumbnail run took about 5 minutes to process 150 images.

Leave a Reply

Your email address will not be published. Required fields are marked *