Focus Stacking in Landscape and Architectural Photography

George Douvos

What is focus stacking?

Focus stacking has one purpose: to achieve huge depth of field.

The technique is, in principle, quite simple: Take multiple shots of a scene, each shot focused at a different distance, and then load those shots into specialist focus stacking software. That software extracts the sharp portions of the images, while rejecting all the blurry stuff, in order to create a final image that has much greater depth of field than would be possible with a single shot.

How suited is focus stacking to landscape photography?

Focus stacking has tended to be used almost exclusively in macro photography. There are good reasons for this. First and foremost is the matter of need. Depth of field is ridiculously narrow when you’re photographing up close. So, if anyone needs a way to achieve more depth of field, it’s a photomacrographer! Other reasons have to do with how one goes about macro photography and with the nature of the subject matter. Photomacrography is slow, deliberate work requiring great attention to detail (and also specialised equipment). So adding a new technique such a focus stacking is not out of character with the nature of the work. And subjects are usually static, often shot in the studio or, when out in the field, can be rendered static (or very nearly so) through suitable shades against the wind, thus making the focus stacking technique relatively easy to apply.

All of the above gives some clues as to why the technique has not been used very much in landscape and architectural photography.[1] But things are changing. The first change is the arrival of sensors that provide a reasonably high resolving power. Despite the wishful thinking of many customers and photo equipment review sites, sensors have provided, until recently, resolution significantly lower than that of film. Now, with high resolution sensors, coupled with photographers’ propensity to judge their work at 100% zoom in Photoshop, blur is much more obvious. So achieving sufficient depth of field, and the related issue of avoiding as much as possible the effects of diffraction, becomes a more serious matter for landscape photographers. Focus stacking can now be seen as a potential solution to this problem.

The second change is even more recent. This one addresses the issue of technique. A photographer cannot rely on guesswork. He needs to be confident that his efforts out in the field will result in exactly the outcome that he has in mind—he would like to get back to the studio, load his photos into focus stacking software and find that the final, stacked image is exactly what he expected. Without proper technique, focus stacking is merely a toy with which curious photographers may play and explore. With proper technique, focus stacking remains fun, but now becomes a useful tool. Technique is what this article is about. It is about how you can get reliable results from focus stacking. And, importantly, it’s about how to do it as easily as possible.

When to turn to focus stacking

Let’s look at a concrete example: We’re photographing a landscape with a 24 mm lens on a 35 mm format camera, and we would like everything from 1 m to infinity to appear sharp. What do we mean by “sharp?” The word can, after all, mean different things to different people. For our particular example, we’ll decide that we want no part of your image to contain blurs larger than 20 microns. Let’s see if we can get a suitably sharp image from a single shot.

Experienced photographers will know that, in this example, we’re being quite ambitious in the depth of field that we’re after. We’ll need to shoot at a high f-number to reduce defocus blur, but that high f-number will introduce lots of diffraction. So it’s not looking likely that we’ll achieve the image sharpness that we’re after.



Then, on the main screen, we set 24 mm for the focal length and 2 m as the focus distance. Why 2 m? Well, if depth of field is to extend from 1 m to infinity, the ideal focus distance is 2 m (this is just basic depth of field theory—you know, hyperfocal distance and whatnot).



NOTE: For our present purposes, pay no attention to the camera formats listed to the left of the blur spot diameter scale—they are listed there only to show “standard” settings, which experienced photographers will ignore.


Now, why have we chosen f/10 as the aperture?  Well, on “standard” depth of field calculators, you could choose as high an f-number as you like, supposedly getting more and more depth of field as you go higher. But things are done properly here. See those  upper and lower markers on the distance scale? They show the positions of those objects (at 4.08m and 1.33m in this case, respectively) that are rendered in the image as 20 microns blurs. Everything between the markers will produce blurs smaller than 20 microns. The important thing to note is that the blur size that we’re talking about includes the effects of diffraction. If we were to go above f/10, we certainly would get less defocus blur, but the increase in diffraction would outweigh that decrease, and so blur would go up and the markers would move closer to the focus distance, not further away. Shooting at f/10 actually gives the widest possible death of field (if 20 microns is the criterion).

But, oh dear, we don’t have enough depth of field! We wanted to go from 1 m to infinity, but we can’t manage it. We’re not doing anything wrong—it’s just physics imposing its limits.

So, we turn to focus stacking.

What goes on in focus stacking

Let’s say we decide to take two shots (focused at different distances, of course). Each of these two shots will have its own associated depth of field. In deciding to take two shots, we’re conceptually breaking up the scene before us into two sections, a near section and a far section. Perhaps we can achieve sufficient depth of field in each of these sections, and then stack the shots in focus stacking software to obtain an image that is sharp (i.e no blur large than 20 microns) over the whole range from 1 m to infinity. Since these two sections are each shallower than the total range, achieving the depth of field we want may well be possible.

So let’s give it a try: On the main screen, we’ll set our focus distance to 1.33m. (The aperture can stay at f/10.) Notice the two upper and lower pointers on the distance scale? They show that our depth of field extends from 1m to 2m. Now, let’s move the focus distance slider to 4m (leave aperture alone). Notice where the two outer pointers end up? They show depth of field extending from 2m to infinity.



Let’s work out some concrete numbers. But let’s be clear about something: We are not going to undertake “standard” depth of field calculations. Such calculations ignore diffraction and are therefore useless for our purposes. Instead, we’ll use the TrueDoF-Pro depth of field calculator, which includes diffraction effects in its calculations of image sharpness (perhaps TrueDoF-Pro should be called an image sharpness calculator).

NOTE: Although, strictly speaking, you don’t need to do so, you may wish to read the article Image Sharpness vs Aperture before you proceed. It’s nice and short and will help with visualising what’s going on.

We begin on the settings screen, where we set 20 microns as the blur diameter [2]:


Before we go on, let's be perfectly clear about something: In discussing focus stacking, we absolutely MUST take diffraction into account. The whole point of focus stacking is to produce insanely sharp images, and it simply is not possible to do this if you are shooting at apertures that result in significant diffraction blur. If you read anything about focus stacking that does not mention the word "diffraction," and does not treat it seriously, you are reading nonsense.


Well, this is good. We have sufficient depth of field in each of the two sections, and there is no gap between them. If we stack the two shots, we’ll have depth of field extending from 1m to infinity. By the way, TrueDoF-Pro can be set to show blur size at key distances, as shown in the next screenshots. Notice that blur goes up and down (being minimum at the focus distances), but nowhere between 1m and infinity does it exceed 20 microns.



Challenges

Why did we focus at 1.3 m and 2 m? Did it have to be these two particular distances? Actually, yes. But you’ll definitely NOT use a depth of field calculator—not even TrueDoF-Pro—to determine those focus distances. (I used TrueDoF-Pro only to illustrate depth of field matters. Neither it, nor any other depth of field calculator, is designed for focus stacking calculations.) You’ll see in a wee while how we determine the focus distances and aperture that we need. Let’s look at some other issues before we go there, though.

What happens if we decide we’d rather have no blurs larger than 15 microns in our image? Well, if we drop the blur spot diameter setting to 15 microns, this is what happens on the main screen:



The depths of field of the two individual shots are now too shallow (according to our new, more demanding sharpness criterion). And we can’t make them deeper by choosing a larger f-number, as one would be tempted to do on a “standard” depth of field calculator. In fact, we actually had to drop the f-number to f/7.1 to get maximum depth of field. (If we had kept the f/10 setting, the diffraction blur itself would have been greater than 15 microns, rendering absolutely no part of the image sharp enough for us.)

If we shoot at these settings, we’ll end up with focus banding. In the final, stacked image the objects at the two focus distances, and objects either side but close to those focus distances will appear sharp (by which we mean sub 15 microns), but objects at around 1m, at around 2m and at infinity will not be sharp (they’ll result in blurs larger than 15 microns). Needless to say, that won’t do—focus banding definitely needs to be avoided.

Do we perhaps need to take more than 2 shots in order to get the image sharpness that we’re now after? Yep, we sure do! If we want no blur spots larger than 15 microns, we need to take four shots, focused at 1.1m, 1.6m, 2.7m and 8.0m. And we need to shoot at f/7.1.

Notice something interesting here? Depth of field is shallow at short distances, so we need to focus most of our shots up close. Notice, also, that we shoot at a lower f-number. Because we are taking more shots, the depth of field of each shot can be shallower. So we don’t need a large f-number to achieve the required depth of field.

But, you’ll be asking now, in undoubted desperation, how on Earth did I know that we should shoot at those particular focus distances and at that particular aperture?

Shooting to get the results we want

Knowing what shots to take is simply a matter of doing the right calculations. Of course, you’ll protest (with justification) that the last thing a photographer wants to do is to interrupt shooting to do tedious calculations or to look up tables. Working out what shots to take is something that should fit seamlessly into the creative process, and should take as little time and effort as possible.

A key decision that you’ll need to make is how sharp you want your final, stacked image to be. As you’ve probably worked out, the sharper you want that image to be, the more shots you’ll have to take in order to achieve that result, so you’ll likely try not to go overboard with your image sharpness target. (For ultimate image sharpness, you’ll choose a blur spot diameter that is at the limits of what your camera’s sensor can resolve, but not smaller, because that achieves no increase in image quality.)

Then, here’s the natural way to proceed:

First, you compose your shot. Once you’ve done that, you’ll have three bits of info: the focal length of the lens you chose to use, and the distances to the nearest and furthest objects in your composition.

That info (and your image sharpness criterion) are all you need in order to calculate the number of shots to take, the distances on which to focus those shots and the aperture to use. And you don’t even need to do the actual calculations—you let an app do that for you. And here's the app that will do it: FocusStacker.

Let’s see it in action. Set the blur spot diameter to 15 microns. Set the focal length and the distances to the nearest and furthest objects.



That’s it, you’re done. Just read the outputs and take the specified shots. [3]

Yes, this is all fast and easy, which is important. What’s even more important is that it provides certainty. It standardises the process of focus stacking, giving predictable results. There is no guesswork.

Subject motion

Subject motion is one other challenge that we need to address. Of course, subject motion is not necessarily a problem in regular (single shot) landscape photography. Motion blur that results from a long exposures can, in fact, look quite good (or it might not, depending on what you’re after). But subject motion causes very different effects—extremely ugly effects—when one is using focus stacking.

Imagine you’re photographing a scene that contains foliage—some up close, some far off. There is a breeze that is blowing the foliage around a bit. You focus on the nearby foliage and take two shots. You change nothing between shots, not even the focus distance. What do you get when you stack the photos? Well, the foliage in the first shot occupied a particular position. In the second shot, taken a short time later, it occupied a slightly different position, by virtue of having been blown around in the wind. So the final, stacked image will show two images of the foliage. This is not motion blur. It is two superimposed images of the same thing in different positions. It looks terrible.

But, you’ll undoubtedly point out, this is not exactly what we do in focus stacking. What we do is that we vary the focus distance. So let’s see what happens when we do that.

Again, you take only two shots, but this time the first one is focused up close, the second far off. In creating the final image, the focus stacking software will keep only the sharp detail. It will discard the blurry far-off detail in the first photo and will also discard the blurry up-close detail in the second photo. So let’s see now what happens to the nearby foliage. In the first shot, it occupied a particular position. In the second shot, taken a short time later, it occupied a slightly different position, again by virtue of having been blown around in the wind. But the nearby foliage in that second shot is blurry, so it is discarded—it does not make it into the final image. And that’s good. No problem, then with subject motion. And an analogous situation with regard to the far-off foliage means we have no problem there, either. So where’s the problem?

The problem is in the transition region between the sharp nearby stuff and the sharp far-off stuff. In that region, you will end up with double images of things that move in the wind (or move for any other reason). When things appear equally sharp, or almost equally sharp, the software keeps both images of them. The problem is made worse if you take more than two shots. The more shots you take, the greater likelihood that you’ll end up with trouble.

So how do we address this issue of subject motion?

Well, we do so in several ways—some rather obvious, others not so. Let’s look first at the more interesting things.

You will need to take as few shots as possible, and you will need to take those shots at the right focus distances. That last bit is very important. If you take shots that have focus distances that are too close together, there will not be sufficient variation in sharpness between the shots, so the stacking software will preserve multiple images of objects. The trick is to take shots in which the focus distances are far enough apart to minimise such problems, but are not so far apart that you end up with focus banding. You can’t just shoot away, taking a huge number of photos and think that stacking them will produce great results. No, you need to take the right number of shots, focused at the right distances. This way, you may not necessarily eliminate multiple images, but you’ll reduce such occurrences—you’ll have the focus stacking software working with you rather than against you.

Fortunately, you already know how to determine the minimum number of shots to take and what the focus distances need to be: You use FocusStacker.

Is there a way to completely avoid multiple images? Yes: Avoid subjects that move, or shoot when there is little or no wind. You’ll be surprised at how often that’s possible in landscape photography. Is there a way to eliminate multiple images that do make it through? Yes: You remove multiples in the stacking software (see the instructions that come with your chosen software). That can be tedious, though. So you’ve got yourself another reason to take as few shots as possible.

In practice, you may find yourself using combinations of techniques to avoid multiples. You’ll always shoot at the right settings, and you’ll definitely avoid subjects with obvious, dramatic motion and, where necessary, you’ll fix things in software.

Other matters

The remaining stuff falls under the “common sense” category. And there’s not much of it:

Shoot on a tripod. Keep framing consistent between shots.

Keep exposure consistent between shots. (Thankfully, doing that is facilitated by the fact that the optimum aperture remains the same for all of the shots in your stack.)

Conclusion

Taking several shots of the same scene, each shot focused at a different distance, and then stacking them, will result in greater depth of field than can be achieved with a single shot. Focusing those shots at random distances, and shooting at an aperture that seems intuitively right, will work, but it won’t produce consistent, predictable results and certainly won’t guarantee the best possible quality. To achieve those things, you’ll need to determine, for the scene you’ve composed, and for the image sharpness that you’re after, the optimum number of shots to take, the distances on which to focus those shots and the aperture setting to use for those shots. And you’ll want to do that with minimal effort, as an integral part of the creative process. FocusStacker. was designed to provide exactly that functionality, so that photographers out in the field can apply a simple, easy and rational method to and achieve predictable results.




[1]

It’s going to get rather cumbersome to keep referring to “landscape and architectural photography.” So I’ll just shorten it henceforth to “landscape photography.” But you’ll know what I mean.


[2]

If you’re used to thinking in terms of circle of confusion, then you can think of blur spot diameter the same way. By “blur spot” I mean the real-world blur that results from the combination of defocus and diffraction. For a short discussion on how easy it is to shift your thinking on this, see the article Moving Away from Circle of Confusion... Without the Confusion.


[3]

I won’t go into optical science here. Suffice it to say that FocusStacker uses a version of the optimisation algorithm originally developed for the OptimumCS-Pro app.



© 2013-2018 George Douvos

Home     Articles