Adding a Scale Bar to Microscope Images (using Photoshop)

With the later versions of Photoshop CS4 and CS5 extended it is now very easy to add a scale bar to your microscope images. But before we go ahead you will need some information first.

1) The actual Pixel size of the camera attached to your microscope (here is a short list of some common cameras).

2) Did you use any binning when acquiring the image?

3) The lens magnification, C mount, and Objective Magnification (NB: normally lens and C mount are 1x, while objectives are e.g. 63X, 100X)

4) A bit of maths.

Actual Pixel size = CCD Pixel X Binning / Lens Mag x C mount X Objective Mag

Example 1:

Zeiss AxioimagerZ1 with a Coolsnap HQ2 camera,100X objective, 1×1 binning.

APS = 6450*1 / 1*1*100
= 6450/100
= 64.5nm

Ok so now if you want to add a 5µm (5000nm) scale bar to your image you now do this

5000/64.5= 77.8 pixles   So a line that is 77.8 pixels long will be exactly 5µm. Unfortunately the add scale bar feature in Photoshop does not allow for decimal places so its best to round to the closest full integer which in this case is 78 !

So now go to photoshop and from the Analysis menu select “set measurement” then “custom”. Here you can enter 78 for the pixel length and then 5 for the logical length and change the logical units to µm.
Save this as a preset to save time next time you have an image from the same microscope with the same settings.

This slideshow requires JavaScript.

Tags: , , , , , , ,

About Andrew Burgess

Head of the Cell Division Lab and Manager of the Microscope and Flow Facility at the ANZAC Research Institute.

21 responses to “Adding a Scale Bar to Microscope Images (using Photoshop)”

  1. Elyse says :

    Extremely handy post!! Cheers!

  2. shirish narnaware says :

    Many Thanks…

  3. Purushotham Reddy says :

    Hi, Thank you very much for the informative post. I was badly in need of something like this. A small suggestion: It would be really nice, if a default values of all the needed info to put into the formula can be tabulated, based on various microscope models and camera types? I know, it is tedious, but could possibly make it much more easy for researchers in future.

    Thanks again and I will be your new subscriber 🙂


    • ScienceTechBlog says :

      Yes that would be nice, but unfortunately I don’t have the time to do this, there are now so many different combinations out there that it would be quite a big task to compile all that info, and more importantly keep it up to date. But there is a short list that I have linked to in the post, which might have the info your after.

      • Purushotham Reddy says :

        Thank you for the quick response. I do understand.Guess the table linked to the post should help. I just was scouring through the blog to catch up with your previous posts 🙂 Liked it. Have always been in search of such a blog. Thank you once again.

        Keep them coming 🙂

    • galicolagfb says :

      I have prepared a sort of a table. See here:

  4. Kate says :

    Hi, I am just wondering how you find the actual pixel size of your camera? Thank you for the helpful post!

  5. Steve says :

    How do you get the CCD pixel. I mean, sony (in the table) has pixel size 6350×7400. What is the ccd pixel to be used in the formular?

    • ScienceTechBlog says :

      Check the website of Sony for the pixel size… or the size of the ccd chip, which you can then use to work out the pixel size.

      • Steve says :

        Am sorry, but what I meant to ask is: The camera shows pixels as a number multiplied by another. In your example, Coolsnap HQ2 camera pixel size is 6450*6450, yet in the calculation you just used one 6450 (as ccd pixel). In my case, , the camera shows 640*480. I dont know whether to use 640 or 480 in the calculation. (I just used the sony example because its a similar case)Thank you.

    • galicolagfb says :

      From what I was told, if you have a rectangular CCD pixel (re your example), then you have to calculate both pixel width and length (i.e. calculate for 6350 and for 7400). I guess for the length of the scale bar, you should use the length of the pixel size.

  6. Angelika says :

    I am using Photoshop CS6 on a mac, and no matter in what format I open my image, the function Image>Analysis>Place marker scale is inactive (i.e. is displayed in gray and cannot be selected). I am not sure what I am doing wrong..

  7. mobuksh says :

    Thanks for this great information!

    1 – Could I confirm a reversed use of this example: If I drew a scale bar on my image to a length that I thought suited it (eg 77.8px long), then I could accurately label this bar by using 77.8px * 64.5nm = 5000nm (5µm)

    2 – Could I please ask, with the 64nm that comes out of your example calculation – what is the unit equivalence? What I mean by that is, is it 64nm of scale per pixel in the image?

    3 – Last question (sorry!): What logic is behind the unit – how is it calculated to be nm as opposed to µm etc? Sorry about the detail here, I’m just trying to make sense of all this before I pass this information on to others.

    Thanks in advance for any help 🙂

  8. Umasankar Patro says :

    Hi. I have an optical micrograph taken at 100X. I don’t know the pixel size of the image nor that of the microscope camera.Can I still add a scale bar on the image?

    • ScienceTechBlog says :

      If its still in the original file format from the microscope its possible that that data is contained within the image meta data, and programs like Fiji/imageJ should be able to automatically read that. But if its a generic tiff or jpg then you’re probably out of luck.

  9. Ruby says :


    We use a program called OpenLab which adds a pixel bar to the images. Would I still have to calculate the pixels if the bar on the image gives it to me?

  10. Sam Naghih says :


    Could you please let me know the CCD Pixel of Nikon YS series? It is really important for me. I have an image captured by this microscope and now I am out of the lab. So, I can not see CCD from the instrument. Do you have any suggestion?


Trackbacks / Pingbacks

  1. Calculating the pixel sizes on images | greenfluorescentblog - January 11, 2013

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: