Size is a Relative Thing
Inserting scale bars on to digital images

Ron Neumeyer - Canada


Introduction

If you are using a digital imaging system, and need a scale bar on your image, no problem, this article tells you how. Although it is based on the Nikon Coolpix (CP) 995 and JASC Paint Shop Pro (PSP) software, it should be a simple matter to use the procedure with other products. Aside from the camera and software, you will need one more item – a stage micrometer (these come up all the time on ebay - any brand will do).

Your mission ("should you accept it") is to create a “master” JPEG template of a set of scale bars covering the magnification range you normally use (click thumbnail below to see the one I use). In other words, if you use a 10x relay (eyepiece), three objectives, one image capture size/resolution, you would have a total of 4 separate scale bars within the master template file. As will be explained, each can be extracted from the master by “cropping and copying” for inserting on to a target image.

scale.jpg (135767 bytes)
Master Image

NOTE: Most digital cameras can be zoomed – both optically and digitally. A nice feature, but one that is best avoided for scaling purposes. For the CP995 I follow the procedure recommended by Aaron Messing, using just enough zoom to fit the rectangular capture zone (3:2) within the field of view. My master is based on this arrangement.

Making the Master File

Step 1 - To get things started you will need to create the master template, on to which your scale bar "collection" will be pasted. This can be done by imaging an empty field of view in bright field. The magnification setting is not important. You are creating a “blank slate” having the same dimensions, and resolution, as your microimages. You can also do this via your graphics software by creating a new file of appropriate width and height, and resolution ("New Image" in PSP). Name and save the file (set-up a separate folder for this exercise, and save to this folder).

Step 2 - Place the stage micrometer on the stage, and focus using the lowest magnification. Take a picture of the micrometer. Repeat this for each objective. I recommend you name the file to match the objective (and Optovar magnification changer settings if you use one). For example, your 4x would be “4.jpg”, if you use an Optovar you can add the setting, for example “4125.jpg”.

Step 3 - Open your low power micrometer image. PSP has a text entry option, as do most graphics programs; this is used to create the bar. Activate this option. Key in the length as underlined text (you will need to play with font size to make it visible). The underlined text should appear on the image. To extent the line below the text to the right length use the line key.  As the background will be white you can select any text colour – I recommend red or black. Once this is done select “okay” and the line and text should appear on the micrometer image. You can save, or delete, this image as it is no longer needed.

Step 4 - Open your master template file and select the text option. With PSP this will bring up the last entry, the one you just created – which is fine. Now select okay and the line and text will be inserted on to your master template image. (As the picture of my master illustrates, I chose to add a header above the scale bars indicating the respective objective - there are three bars under each objective that match my Optovar settings). Place the bar where you want it and save the file. Repeat this process for each micrometer picture, pasting the line and text on to the master until you have covered the magnification range (be sure to save every change to the master). Avoid placing the bars close together as the insertion process will be easier if there is adequate free space around each bar.

The image below (click for a full size view) illustrates the process, the last box would be your master template.

scalerow.jpg (33082 bytes)
Creating a scale bar image

Inserting a Scale Bar

Open the master template and select the appropriate scale bar. Employ the “cropping” tool to outline the bar and text. Now crop BUT do not close the file. Instead, copy the cropped scale bar image. In PSP this is done clicking the right hand mouse key and choosing “copy”. Close the file (do not save) and open the image that needs the scale bar. In PSP, clicking the right mouse button, and selecting “paste as new layer”, will insert the bar on to this image. Without closing this option move the scale to the top or bottom corner and select save (with PSP this will permanently embed the bar in the image – so you may want to save it under another name).

Here are a few examples of the final product (Note - I now use a white background, rather than clear, as this avoids having the scale bar "disappear" in the image if the text colour is the same as your picture):

Questions are welcome.

All the best,

Ron Neumeyer

 

 Microscopy UK Front Page
Micscape Magazine
Article Library


© Microscopy UK or their contributors.

Published in the August 2003 edition of Micscape.

Please report any Web problems or offer general comments to the Micscape Editor.

Micscape is the on-line monthly magazine of the Microscopy UK web
site at Microscopy-UK


© Onview.net Ltd, Microscopy-UK, and all contributors 1995 onwards. All rights reserved. Main site is at www.microscopy-uk.org.uk with full mirror at www.microscopy-uk.net.