November 30, 2011

Label an image series from their filenames

What if you have a series of images (say, a series of plots at different times or screen captures at different experimental stages) and you want to quickly include them in a note without having to manually type out a description for each one?

Well, if you gave each image a descriptive filename when you created them, you're in luck!

Consider the following note which contains a series of diffraction patterns after a certain number of monolayers (ML) of material has been grown:

What's going on?  It's impossible to tell what's what.  You could manually type descriptions of these images, but if you have 70 images instead of four, things get tedious.

The solution I've found is to use the freeware FastStone Image Viewer to expand each images' canvas and add its filename in the space created.  If your filenames are descriptive, this effectively auto-labels the images.

I'll describe the steps, but first the result (my filenames are 01 ML.png, 02 ML.png, 03 ML.png, and 05 ML.png):


Pretty slick.  The process was performed in batch so it takes about one minute to accomplish regardless of the number of images you have.

So, how to do it?  Well, after the FastStone Image Viewer is installed, fire it up and navigate to the folder containing your image series:


Select the images you want to process using the mouse or Ctrl-A then press F3 or go to Tools->Batch Convert Selected Images:


On this page, you can select your output file format, specify an output path, etc...


To get the magic to happen though, you need to select Use Advanced Options and click the Advanced Options button.  The following two images show how to set things up to add whitespace at the bottom and then fill it with the filename (minus the extension):



Once that's done, hit OK to get back to the Advanced Options screen and click the Convert button.  Voila.  The new images have been dumped into the specified output directory with the filename labels added.

A couple notes:
  1. If your filenames are long, you may need to add double or triple the whitespace to give them room to wrap.
  2. For some reason, selecting a bunch of images and pasting them into Evernote inverts their order (as seen in the folder or the FastStone Viewer).  You can simply inverse sort them or manually arrange them in the FastStone viewer before dragging with this in mind.
Hope that's helpful!

No comments:

Post a Comment