• site home
  • blog home
  • galleries
  • contact
  • underwater
  • the bleeding edge

the last word

Photography meets digital computer technology. Photography wins -- most of the time.

You are here: Home / The Last Word / Optimizing f-stops and focus distance for landscapes

Optimizing f-stops and focus distance for landscapes

April 23, 2019 JimK 22 Comments

This is a continuation of a series of posts about blur management for landscape photography. The series starts here.

Here’s a situation in which many landscape photographers often find themselves:

  1. There are important objects at various distances from the camera.
  2. There is too much subject motion to be able to use focus stacking or stitching techniques.
  3. There is not enough DOF available at low-diffraction apertures for all the objects to be sufficiently sharp at those stops.
  4. The photographer is uncertain what f-stop to pick and at what distance to focus in order to maximize the sharpness of the important objects.

I wrote a program to assist in the aperture and focus distance decisions. It takes the code that produced the graphs in the previous post, plus two additional set of information:

  1. A list of the distances at which the important subjects reside.
  2. A list of weights that describe the relative importance of those subjects.

The program spits out the optimum f-stop and focus distance, and plots the sharpness of those settings as a function of distance. As before, diffraction and DOF are considered, but not lens aberrations.

Let’s take it for a spin. If we put a 63 mm lens on a GFX 50S, at tell it that we have equally important subjects at 10 and 100 meters, here’s what we get:

The two vertical lines mark the distances of the important parts of the image. F/16 is the optimum f-stop. That is deep into diffraction blur territory, and the resultant sharpness at 10 and 100 meters isn’t great, but anything wider — and anything narrower — would be worse.

This graph puts the lie to a couple of hoary rules of thumb:

  1. You should focus a third of the way from the closest thing you want sharp to the furthest.
  2. You shouldn’t use apertures where there is a lot of diffraction blur.

Once you decide to shoot at f/16, you could compute the distance to focus using conventional DOF calculators, but you wouldn’t have a sharpness metric that took diffraction into account.

Now let’s add a third distance, leaving the weights all the same:

That moves the optimum focal point a bit further away, and says we can open up the lens fractionally. The differences are immaterial to real-world photography.

If we double the weight of the closest part of the subject:

About what you’d expect.

Next up: taking the optimizer out into the world.

 

The Last Word

← Choosing f-stops and focus distance for landscapes Optimizing aperture and focus distance, an example →

Comments

  1. Carsten says

    April 25, 2019 at 1:51 am

    Thanks a lot for this very interesting series of posts! This is a really relevant topic.
    I have one hint and some comments.

    Hint
    There is an iPhone app called OptimumCS-Pro, developed by George Douvos (see http://www.georgedouvos.com/) which allows you to do a comparable optimization in the field. You can enter the focal length as well as the nearest and the farthest distance and it calculates the optimum focusing distance and f-stop as well as the blur spot diameter at the nearest and farthest distances, taking diffraction into account. This is less than you do, there is no plot of the blur spot diameter over distance, it doesn’t even tell you the blur spot diameter at the focusing distance, and you can only enter two distances, but it is very intuitive and easy to use in the field.

    I don’t know the math behind this app, and it seems to be a little different from yours, since it gives slightly different results. Using your example of an f=63 mm lens with the nearest distance at 10 m and the farthest at 100 m it calculates 18.2 m for the focusing distance (which is pretty close to yours), an f-stop of f/11 (instead of f/16) and a blur spot diameter of about 21 Microns (which I cannot compare, see second comment below). So, who is right – we don’t know.

    Comments
    • The absolute blur spot diameter given in Microns should depend only on the lens parameters, not on the sensor parameters. But your plots are given for a specific pixel pitch and fill factor of the sensor. I do not understand this.
    • For me the absolute blur spot diameter is quite an intuitive value and metric to calculate. Even more intuitive would be the ratio of the absolute blur spot diameter to the pixel pitch of the sensor, although this would result in a sensor specific calculation with one more parameter. But your “blur circles per sensor height” metric is not intuitive at all (for me) and I failed in converting the blur circles per sensor height value to an absolute blur spot diameter for your example above. I don’t care for the sensor height, I only care for the pixel pitch when it comes to sharpness.
    • I find it difficult to intuitively understand the optimization for more than two distances and even more so with different weights. Three distances can never have the same sharpness, so, what do I ask the optimization to do? And what does a weight of 2 for one distance mean compared to a weight of 1 for the other distances? Should points at this distance be twice as sharp as the ones at the other distances, i.e. with half the blur spot diameter? Probably you do a kind of least squares optimization with different weights for the different distances but this has no intuitive relation in the field – at least I am not able to see it. Maybe you can give us a hint on how to interpret this.

    Reply
    • JimK says

      April 25, 2019 at 6:52 am

      The absolute blur spot diameter given in Microns should depend only on the lens parameters, not on the sensor parameters. But your plots are given for a specific pixel pitch and fill factor of the sensor. I do not understand this.

      I take into account the blur introduced by the sampling aperture on the sensor. That’s why fill factor and pitch are necessary inputs.

      Reply
      • Carsten says

        April 25, 2019 at 11:55 am

        Ok, understood.
        This is definitely not taken into account in George Douvos’s app. But does this explain the different results using your example, i.e. a full stop difference for the optimum f-stop?

        Reply
        • JimK says

          April 25, 2019 at 12:27 pm

          Don’t know. What does he round to? I round to integers for f-stops > 10.0.

          Reply
    • JimK says

      April 25, 2019 at 6:53 am

      For me the absolute blur spot diameter is quite an intuitive value and metric to calculate. Even more intuitive would be the ratio of the absolute blur spot diameter to the pixel pitch of the sensor, although this would result in a sensor specific calculation with one more parameter. But your “blur circles per sensor height” metric is not intuitive at all (for me) and I failed in converting the blur circles per sensor height value to an absolute blur spot diameter for your example above. I don’t care for the sensor height, I only care for the pixel pitch when it comes to sharpness.

      When making same size prints from various sized sensors, computing blur diameters per picture height levels the playing field, much the same way as computing MTF50 in cycles per picture height does.

      Reply
      • Carsten says

        April 25, 2019 at 12:01 pm

        I have to admit I need to do some research to understand this, but thanks for the hint.

        Reply
      • Jerry Fusselman says

        May 14, 2020 at 7:09 pm

        It levels what playing field? Are you perhaps attempting to equalize quality of print regardless of image-sensor size?

        Reply
        • JimK says

          May 14, 2020 at 8:56 pm

          I’m trying to take sensor size out of the picture as much as I can, concentrating on what is visible in the print.

          Reply
          • Jerry Fusselman says

            May 19, 2020 at 2:28 pm

            Let’s see if I understand.

            If I use your technique twice, first with an APSC camera, then a full-frame camera with a lens of the same focal length, and if I select the same laser-measured distances and weights for your formula both times (to select aperture and focus distance), will the result (assuming perfect lenses with the same pixel pitch) of both prints be the same if object sizes are the same in both prints, but the full-frame print will have more coverage?

            If so, it sounds like your concentration on “what is visible in the print” ignores viewing distance. It sounds to me like the right way to do it. There’s no reason to say that a larger print precludes a close look. If I cut piece out from a print, the quality of that piece of the print hasn’t changed.

            Reply
            • JimK says

              May 19, 2020 at 2:41 pm

              If I use your technique twice, first with an APSC camera, then a full-frame camera with a lens of the same focal length, and if I select the same laser-measured distances and weights for your formula both times (to select aperture and focus distance), will the result (assuming perfect lenses with the same pixel pitch) of both prints be the same if object sizes are the same in both prints, but the full-frame print will have more coverage?

              Yes.

              Reply
    • JimK says

      April 25, 2019 at 6:57 am

      Probably you do a kind of least squares optimization with different weights for the different distances but this has no intuitive relation in the field – at least I am not able to see it.

      I do indeed minimize a cost function that is the sum of the weighted squared errors at each distance. The optimizer isn’t very accurate at distances less than 10 times the focal length of the lens, but consider a portrait. I’d weight the eyes heavily, and the forehead and lips less, and the shoulders even less.

      Reply
      • Carsten says

        April 25, 2019 at 12:16 pm

        Ok, lets take your portrait example, which I think is a good one.
        I want maximum sharpness of the eyes (so I know in advance that I must focus on the eyes), I want reasonable sharpness of the lips, and there is a little tattoo on the cheekbone, which should be sharp as well, but doesn’t need to have optimum sharpness. How do I tell this to your optimizer — without using trial and error?

        Reply
        • JimK says

          April 25, 2019 at 12:33 pm

          I think that you may not want to focus on the eyes, but just weight them more heavily. If you’ve already decided to focus on the eyes, then the optimizer won’t work as designed: it needs to vary both focus position and aperture. I think, after using the optimizer for a while, you can get a sense of the right weights for your situation. The fact that it shows you sharpness vs subject distance as part of its solution means that you can see how sharp things are at the various distances that you’ve specified. In your situation, I’d give the eyes a weight of 4, the lips 2, and the tattoo 1, run a pass and see what happens.

          Reply
      • Jerry Fusselman says

        May 14, 2020 at 7:12 pm

        In your cost function, what is your formula for errors?

        Reply
        • JimK says

          May 14, 2020 at 8:57 pm

          The error metric is blur circle size. There is a lot more on the specifics of that in subsequent posts.

          Reply
      • Jerry Fusselman says

        May 14, 2020 at 7:16 pm

        Jim wrote, “The optimizer isn’t very accurate at distances less than 10 times the focal length of the lens.” That surprises me. What makes it less accurate at these shorter distances?

        Reply
        • JimK says

          May 14, 2020 at 8:58 pm

          I used the thin lens equation, which is not accurate with modern lenses focused closely. I also ignored lens extension, and floating-element induced focal length changes with focused distance.

          Reply
          • JERRY FUSSELMAN says

            May 19, 2020 at 1:56 pm

            Thanks. In what way did you ignore lens extension? Lens extension is already accounted for in the thin lens equation, correct?

            Reply
            • JimK says

              May 19, 2020 at 2:04 pm

              In what way did you ignore lens extension?

              I ignored the fact that effective f-stop changes with focused distance.

              Reply

Trackbacks

  1. Optimizing aperture and focus distance, an example says:
    April 23, 2019 at 3:45 pm

    […] the last post, I showed you the results of a blur management optimizer that I wrote this morning. Now I’m […]

    Reply
  2. Optimizing aperture and focus distance, another example says:
    April 30, 2019 at 3:18 pm

    […] the last post, I showed you the results of using a blur management optimizer that I wrote on a scene using the […]

    Reply
  3. DOF and Diffraction: 24mm Guidelines | Strolls with my Dog says:
    April 5, 2020 at 4:02 am

    […] PSF of the CoC is a solid disk.  His results are in line with those in this page and can be found here. 2. See “Development of the I3A CPIQ spatial metrics, Baxter et al.”  for the Camera […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

May 2025
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031
« Apr    

Articles

  • About
    • Patents and papers about color
    • Who am I?
  • How to…
    • Backing up photographic images
    • How to change email providers
    • How to shoot slanted edge images for me
  • Lens screening testing
    • Equipment and Software
    • Examples
      • Bad and OK 200-600 at 600
      • Excellent 180-400 zoom
      • Fair 14-30mm zoom
      • Good 100-200 mm MF zoom
      • Good 100-400 zoom
      • Good 100mm lens on P1 P45+
      • Good 120mm MF lens
      • Good 18mm FF lens
      • Good 24-105 mm FF lens
      • Good 24-70 FF zoom
      • Good 35 mm FF lens
      • Good 35-70 MF lens
      • Good 60 mm lens on IQ3-100
      • Good 63 mm MF lens
      • Good 65 mm FF lens
      • Good 85 mm FF lens
      • Good and bad 25mm FF lenses
      • Good zoom at 24 mm
      • Marginal 18mm lens
      • Marginal 35mm FF lens
      • Mildly problematic 55 mm FF lens
      • OK 16-35mm zoom
      • OK 60mm lens on P1 P45+
      • OK Sony 600mm f/4
      • Pretty good 16-35 FF zoom
      • Pretty good 90mm FF lens
      • Problematic 400 mm FF lens
      • Tilted 20 mm f/1.8 FF lens
      • Tilted 30 mm MF lens
      • Tilted 50 mm FF lens
      • Two 15mm FF lenses
    • Found a problem – now what?
    • Goals for this test
    • Minimum target distances
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Printable Siemens Star targets
    • Target size on sensor
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Test instructions — postproduction
    • Test instructions — reading the images
    • Test instructions – capture
    • Theory of the test
    • What’s wrong with conventional lens screening?
  • Previsualization heresy
  • Privacy Policy
  • Recommended photographic web sites
  • Using in-camera histograms for ETTR
    • Acknowledgments
    • Why ETTR?
    • Normal in-camera histograms
    • Image processing for in-camera histograms
    • Making the in-camera histogram closely represent the raw histogram
    • Shortcuts to UniWB
    • Preparing for monitor-based UniWB
    • A one-step UniWB procedure
    • The math behind the one-step method
    • Iteration using Newton’s Method

Category List

Recent Comments

  • bob lozano on The 16-Bit Fallacy: Why More Isn’t Always Better in Medium Format Cameras
  • JimK on Goldilocks and the three flashes
  • DC Wedding Photographer on Goldilocks and the three flashes
  • Wedding Photographer in DC on The 16-Bit Fallacy: Why More Isn’t Always Better in Medium Format Cameras
  • JimK on Fujifilm GFX 100S II precision
  • Renjie Zhu on Fujifilm GFX 100S II precision
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • Ivo de Man on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF

Archives

Copyright © 2025 · Daily Dish Pro On Genesis Framework · WordPress · Log in

Unless otherwise noted, all images copyright Jim Kasson.