I am a software developer writing a software interface for a Bosch mic 9000i camera. I have an interface to change the focus of the camera and I'm writing documentation for an end user. The numeric focus values that the camera accepts are 0-255. I've been referring to the value range as the magnitude. What should I call a numeric focus value for a camera?

When I increase the focus value, the camera shifts focus to closer objects, decreasing the number brings further objects into sharper focus. Is there a better way to phrase this than 'Focus Near' and 'Focus Far'?

  • Having written code for stuff like this I feel your pain. In my system there is a preset "near focus" button and "far focus" with a pair of in and out buttons. Adjust the focus using near and far. Then a long press on the "far focus" sets it, and a brief press recalls it. My boss always sets them the wrong way round - focusing on an object and then setting the wrong button and then gets confused. (Near & Far Focus buttons should just be called preset A & preset B)
    – D Duck
    Mar 25 at 21:04

2 Answers 2


Photographers don't care about the 0 to 255 values, they care about the actual focal distance of the lens in real world units (i.e. metres in the vast majority of cases). If you are creating a product for photographers, you should find out how to translate arbitrary numeric values into real-world units and use those.

  • If you're not creating a product for photographers, then the question is off-topic.
    – Philip Kendall
    Mar 24 at 20:14
  • 6
    Agreed. Nobody other than the users of the software interface care about 0–255 limitations of computer number representation. They care about what the input represents. As a user (and even as a software developer), I want to input a useful real-world number, such as focus distance. The software library, API, driver, or whatever, should handle the conversion from human-useful numbers to system-specific digital values, IMO. I've written dozens of such types of specs, and used hundreds, and I always appreciate the ones that abstract the computer-oriented details away from real-world use cases.
    – scottbb
    Mar 25 at 1:14

Minimum and maximum focus (focal) distance. As others have indicated, you'd be appreciated for indicating in a metric like feet or meters. Regardless, increasing and decreasing focus distance seems appropriate.

At the very least, you'll want to change 0 to be the minimum focus distance for that lens, and 255 the maximum. According to BH photo's specs for the model you mentioned, the range is 276 feet - infinity. The values between are an exponential function, so that probably 50 is roughly 2x your minimum distance, but you probably will want to know the exact function.

  • 2
    "You'll want 0 to be the minimum focus distance for that lens, and 255 the maximum." The OP clearly indicates that the internal system he must deal with is the opposite: "decreasing the number brings further objects into sharper focus," so 0 is focus at infinity or as close to it as the system can get. I see no reason to bring the "0" through "255" numbers out to the user either way; a photographer wants to know the focus distance in meters (or possibly feet if he's so unfortunate as not to be familiar with metric).
    – cjs
    Mar 25 at 5:31
  • 2
    "The values between are an exponential function" Are you sure? Typical linear focussing systems would give a hyperbolic function, assuming that the "focus values" correspond linearly to a displacement of the optics. Mar 25 at 10:06
  • Good catch @cjs that OP is treating 0 as infinity. Since they are a software developer writing an interface for end user, I made more clear that the polarity should be flipped.
    – Mark K
    Mar 25 at 15:20
  • @RalfKleberhoff Admittedly I used the term exponential to refer to any changing rate of change, sorry for sloppy wording. Would a hyperbolic function suggest a different (kind of) rate of change than the example I had provided immediately after the quoted line?
    – Mark K
    Mar 25 at 15:27
  • The word you're looking for may be "non-linear". Mar 25 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.