Using JavaScript to standardize photomicrographs for normalized Fry analyis

For my senior thesis I am conducting grain-scale strain analysis of the Binnewater Sandstone from the area of Rosendale, New York. The process involves collecting oriented samples in the field, preparing them for mounting as petrographic thin sections, taking digital photomicrographs, and analyzing them using computer software. As it turns out, taking the photomicrographs and preparing them for analysis is an exercise in tedium since there are over a hundred pictures. Preparing each photomicrograph by "hand" (using Adobe Photoshop) would be time consuming and provide many opportunities for human error. I figured out how to use Javascript with Adobe Photoshop 7 to automate the process. This saved countless hours and standardized the photographs.

Here is a sample of a photograph before processing. Note the excess black space on the sides and the lack of any markings to orient this picture. Click for a [much] larger picture.

photomicrograph before

Here is the same picture after processing. Key things to note: the black space has been cropped out to maximize the important piece of the image, the file name and orientation information has been added to the upper left corner, a scale bar has been added to the upper right corner, and the optical properties have been added to the lower left corner. Click for a [much] larger picture (full image is around 2MB so if you have a slow connection you will wait a while.)

photomicrograph after

Embedding all this information in the picture acts as a back up in case the photograph's filename was separated from the identifying information. This also makes it more convenient for working with the photograph because all the information is readily available.

I will also post sample code once I "pretty it up."