Skip to main content
alanterra
Inspiring
September 27, 2011
Question

Create a scale bar? Thoughts?

  • September 27, 2011
  • 3 replies
  • 4512 views

Hi

I was wondering if anyone has thought about the best way to create a scale bar for a photo, that is automatically the right size.

My photos have an exif field "Subject Distance" which, along with the sensor size and the lens length, could be used to create a scale bar that can be put into a photo.

I am uncertain whether it would be better to try to do this in Photoshop, or to build a frame in In Design. It would be really wonderful if I could figure out how to add the scale bar after I crop the image (since I have a lot of images already cropped), but that might be asking too much?

Any thoughts before I explore all the blind alleys?

FWIW, I am quite comfortable scripting in AppleScript, but have never tried the JavaScript abilities for Photoshop (a big learning curve, I would guess).

Thanks

Alan

This topic has been closed for replies.

3 replies

Participant
September 29, 2011

Hi alanterra (et al.),

It was Steve Baskauf at Vanderbilt who worked out a proposed method for putting scale bars automaically on photographs based on lens-to-object distance. This was part of our joint work on standarizing methods for photographing plants, methods that Steve pioneered. I have pased a link to his suggested method, below. It still needs to be thoroghly tested. I would appreciate your keeping me informed of how your work on this issue procceds. I am kirchoff(at)uncg.edu (Bruce Kirchoff).

https://sites.google.com/site/liveplantimagegroup/handling-image-metadata/creating-scale-bars-from-metadata

Inspiring
September 29, 2011

FWIW, I am quite comfortable scripting in AppleScript, but have never tried the JavaScript abilities for Photoshop (a big learning curve, I would guess).

If you do quite a lot of scripting with Photoshop… Then its well worth learning the basics of JavaScript at the least… Action Manager code will at the very least quadruple what you can access and edit in images opened with Photoshop… Almost all the examples of this 'in use' are by users calling it from JavaScript/ExtendScript… Yup there's the usual learning curve as with all these subjects… but only you can decide if it warrants the effort or not… You will find plenty of examples of things that you just can't do using the regular object model…

Inspiring
September 29, 2011

I researched this for a client. The good news is if you have Photoshop Extended it is easy for a script to set the scale and create a scale bar.

The bad news is that although the idea that you can determine the subjects scale from the exif data may work in theory I could not use that info to determine the scale with any accuracy. If you are just working with one camera you may be able to come up with something using emprical data but I just don't think it is possible to create a general method that works for any camera.

Another issue I found is some camera makers don't give accurate info on sensor size. Or that the full sensor is not used to create the image. Also in my test with a limited number of cameras most did not record the same subject distance I expected from where I had the lens focused.

To me a scale bar implies accuracy so I dropped the project.

c.pfaffenbichler
Community Expert
Community Expert
September 29, 2011

Also in my test with a limited number of cameras most did not record the same subject distance I expected from where I had the lens focused.

Now that sounds discouraging.

May I ask what business that customer was in?

Just curious because previous scale-matters usually seemed to be related to scientific/archeological purposes.

c.pfaffenbichler
Community Expert
Community Expert
September 29, 2011

I doubt that I could tackle the task, but could you post sample files?

Best would be some test images of rulers, I guess, so that one can start from there, knowing the actual measurements.