Focus Shift is a phenomenon which affects certain lenses and causes the point of focus to shift with a change in aperture. This post takes a look at why that matters, and some results from development testing of Reikan FoCal which allows the effect of focus shift to be quantified.
Why does Focus Shift matter?
First, it’s important to understand that when a DSLR perfoms autofocus, it always runs the operation with the lens wide open. This applies to both phase-detect (“Quick”) and contrast-detect (“Live”) autofocus. The logic behind this is that when a lens is wide open, the depth of field will be narrowest and therefore the camera will most easily be able to distinguish between in-focus and out-of-focus conditions. Due to the way phase-detect autofocus operates, stopping down will significantly affect the performance of the af system and around f/8 is the limit of the phase-detect autofocus system in even the best cameras. Theoretically, contrast detect autofocus can work at any aperture, but as you stop down the lens, less light reaches the image sensor and the resulting image becomes very noisy leading to either intolerably slow or inaccurate autofocus.
So, how does Focus Shift manifest itself? Let’s take the Canon 50mm f/1.2L lens as an example, as this is well known to shift focus on stopping down. When you trigger an AF operation (typically by half-pressing the shutter button), the camera will first make sure the lens is wide open, and will then trigger the autofocus operation. The appropriate lens elements are moved so the image on the sensor is as sharp as it can be at the selected focus point*.
What happens when you fully press the shutter button depends on the selected aperture. If you take a shot at f/1.2, the mirror lifts, the shutter opens and the image will be nice and sharp. But, if your shot was at, say f/2.8, the aperture will be closed down to f/2.8 before the shot is taken, and this is where the problem lies. For a lens like the Canon EF 50mm f/1.2L lens that suffers from Focus Shift, this will cause the correct focus position to change, so when the shot is taken the resulting image is focused in the wrong place!
(* within tolerances, and the image will be sharp at the autofocus sensor. This may not translate to a sharp image at the image sensor due to AF microadjustment being required, but you can read all about that here if you’re interested.)
How do you measure the effect of Focus Shift?
Ah, I’m glad you asked! 🙂 Reikan FoCal started life as a tool to help with camera AF Microadjustment, but FoCal Pro has grown to add a whole host of other tests. One of these is the Aperture Sharpness test which takes a set of shots across the aperture range, measuring the sharpness and showing the results on a chart.
FoCal’s Aperture Sharpness test expects you to focus the lens perfectly when wide open before starting the test run, and then does not adjust the focus position as the test runs. This means the results will be subject to the effect of Focus Shift, which accurately reflects the real-world sharpness of the lens when used with a DSLR which performs it’s focusing when wide open. However, it doesn’t truly reflect the maximum sharpness of the lens at a particular aperture – i.e. the sharpness that could be achieved if the lens was refocused.
Without going into too much detail and boring you, we’ve tinkered with a development version of FoCal to allow us to refocus before the image quality of each aperture is measured. We’ve improved our FoCal AF algorithm so it now works at any aperture, automatically compensating for the sensor noise introduced at narrow apertures. It’s much slower than a camera – taking up to around 15 seconds to focus when the aperture is very small. It works by using a mix of camera control, live image analysis and prediction based on our model of the optical characteristics of the lens to determine optimum focus, and can accurately position the lens at f/32 with light levels of around EV 7 (e.g. 1/8s, f/4 at ISO 100).
The modified Aperture Sharpness tests runs in two passes. The first pass works in the standard way – with perfect focus achieved wide open and the sharpness of each aperture measured across the complete range. The second pass uses the new FoCal AF algorithm to refocus for each aperture, and runs across the full range again. The results are 2 lines on the chart, and the focus shift can be seen as a vertical gap between the lines at certain apertures.
Focus Shift test results
The results below are preliminary. We’ve run with a set of lenses, but the whole testing procedure is still being finalised. The results below are for the following lenses:
- Canon EF 85mm f/1.2L II
- Canon EF 35mm f/1.4L
- Canon 40mm f/2.8 STM
- Canon 24-70mm f/2.8L
- Canon 70-200mm f/4L IS
- Sigma 120-300mm F2.8 DG OS HSM | S (Sport)
- Nikon NIKKOR 50mm f/1.4D
All Canon tests were run with a Canon EOS 7D camera, and the Nikon results with a D800.
Canon EF 85mm f/1.2L II
We’ll start with a nice, well behaved lens – the beautiful and fast Canon 85mm f/1.2L Mark II.
As explained above, the test runs in two passes, resulting in two lines on a chart. Across the bottom is the aperture, with the widest (f/1.2 in this case) on the left and the narrowest (f/16) on the right. The Y axis shows a value which increases with sharpness of the image (note that you cannot compare the Y axis numbers across charts from different tests).
The blue line shows the sharpness when the lens was focused once wide open at the beginning of the pass. This is the same set of results you’d see if you ran the normal FoCal Aperture Sharpness test.
The red line shows the result when the lens is focused to get the best sharpness for each individual aperture.
The graph below shows a lens that exhibits no noticeable focus shift at all – the red and blue lines are almost indistinguishable meaning the focus at any particular aperture is in the same position as when the lens was focused wide open.
Canon EF 35mm f/1.4L
The Canon 35mm f/1.4L exhibits slight focus shift between about f/2.5 and f/10 with a pretty much constant peak-difference between f/4 and f/6.3 (the range of the widest gap between the red and blue line).
In reality, what does this mean to image quality? Well, even the largest vertical difference between the red and blue lines above is pretty small (about 100 QoF units) which equates to the difference shown in the 100% crop image below:
Can you see a difference? There’s certainly not much, so even though the Canon 35/1.4 does technically exhibit some focus shift in reality it’s not going to affect your images.
Canon 40mm f/2.8 STM
Moving on to the new Canon 40mm f/2.8 STM (Stepper Motor) lens (which is personally one of my favourite lenses and makes a beautiful combination when mounted on the Canon 6D – excellent overall image quality, accurate focus and altogether quite a small package).
This lens does show a reasonably level of focus shift. As a reminder, the blue line is the set of results you’d get from a normal FoCal Aperture Sharpness test and from normal DSLR shooting, and it shows a pronounced kink where the quality seems to drop off when wider than the diffraction limited aperture (around f/7 for the 7D which was used for this test), and then suddenly rise just before wide open (around f/3.5).
But if you focus before every aperture to compensate for focus shift, you get the more expected curve which rises up to a peak a little before wide open, then drops off as you completely open the aperture.
Unfortunately, this lens was tested with an early development build which didn’t output the wide/focused images, but as mentioned these are preliminary results and we’ll publish the full result with comparison examples when the test is complete.
Canon 24-70mm f/2.8L @ 70mm
The first zoom lens of the test, our particularly terrible copy of the Canon EF 24-70 f/2.8L (Mark I).
First, the focus shift aspect, as that’s what this post is about. The lens shows negligible focus shift – the red and blue lines are almost overlapping, so there’s no difference between wide focus and aperture-specific focus.
But just briefly, the reason our copy is terrible is the shape of the curve. On the right, the quality drops as you close down due to diffraction softening the image. But as you widen the aperture, you should expect the quality to increase until within a stop or two of wide open and then start to drop**. With our stunning (ahem!) example of the 24-70L, the best aperture is around f/6.3 and then there’s a gradual drop in sharpness. We’ll be sending this lens back to Canon shortly for some repairs, but for now it serves as a good example of an imperfect lens (although one which doesn’t exhibit any focus shift).
** The very best lenses – in particular the new Canon lenses like the EF 24-70 f/2.8L Mark II – appear to stay incredibly sharp and only drop fractionally close to wide open, at least according to visual results and the FoCal Aperture Sharpness test… because they are both based on focus at wide-aperture. It could be that the Canon EF 24-70 f/2.8L Mark II is even sharper at f/4 than we typically see, but only when you manually focus (with DoF preview).
Canon 70-200mm f/4L IS @ 70mm
All fairly reasonably so far – some lenses show some focus shift and some don’t. The Canon EF 70-200 f/4L IS at 70mm is one that exhibits a little focus shift but nothing too exciting, although the chart below does raise an interesting point.
Do you notice the two lines at the widest aperture don’t end at the same point? Right now, that’s one particular issue with the development Focus Shift test (and one of the reasons we’re not releasing it yet). Unless both lines end at pretty much the same point, the results can be considered to be a little suspicious. This is because when the lens is wide open, both the blue and the red line should have the same quality measurement as they’re both focused under the same conditions.
Why is there this discrepancy? It’s most likely due to a a changing in light level during the testing. At the moment, the test takes around 5-7 minutes to run – measuring almost all the time – and any significant light level changes could affect the results.
In any case, taking into account minor light level change, there doesn’t appear to be significant focus shift.
Canon 70-200 f/4L IS @ 200mm
But… at 200mm, the story is somewhat different.
If we look at the red line on the charts between the 70mm and 200mm, there’s a raise in quality up to about f/8. At 200mm, the quality rises sharply to a peak at around f/6-f/7 then drops in the characteristic way.
The blue line tells a different story. When the lens is focused at f/4, the quality of the image does improve as you open the lens aperture for the shot, but nothing like when the lens is focused at it’s correct aperture.
In actual terms, the blue line is fairly characteristic as it rises towards wide open, then drops when wide open, so if this was all you saw on the chart it would not be surprising. But what you don’t normally see is the potential of this lens – the red line – when manually focused with DoF preview (or the camera manufacturers adjust their AF algorithms…)
The 100% crop test captures below show the real-world effect of the difference above. On the left is the image analysed when the lens was focused at f/4 and then stopped down to the test aperture. On the right is the image analysed when the lens was focused at the tested aperture (so f/4, f/8 and f/18):
As the chart shows, you’ll noticed that the f/4 and f/18 shots are pretty similar left and right, meaning that it doesn’t really matter if you focus at f/4 or f/18, the focus point is about the same.
But the middle image shows the difference at f/8. When the lens is focused at f/4, the image is acceptable, but then looking at the image on the right – focused at f/8 – shows the capability of this lens. Quite an improvement, and one that you won’t realise unless you use manual focus with DoF preview or specifically adjust you camera for this aperture (which could be achieved with AF Microadjustment, but will mean that pretty much all other apertures will be sub-optimal).
Sigma 120-300mm F2.8 DG OS HSM | S (Sport)
This next lens – the Sigma 120-300mm F2.8 DG OS HSM | S – is interesting as it’s a bit of a hot topic at the moment. This is the third incarnation of this particular focal length lens from Sigma and although we’ve only had it in the lab for a couple of days it’s looking like a lovely lens.
A lovely lens that exhibits some quite significant focus shift, however.
The chart below shows the numbers, and there’s clearly a large discrepancy between the sharpness from wide open through to about f/11 (at which point it will become almost invisible in shots). To a photographer utilising AF, this lens would appear to be pretty sharp from wide open all the way through to f/11, and then the sharpness would start to fall – which sounds like a great lens (as long as it’s sharp at f/2.8 which for this lens is definitely the case).
But what you’d find is that if you manually focused (with DoF preview) between f/3.2 and f/11, you could get even sharper images.
The image pairs below show this effect at f/2.8, f/5 and f/16 (the wide-open focus is on the left – so this is what you’d capture using normal AF – and the focus at the tested aperture is on the right, both at 100% crop):
Firstly, you can plainly see that the f/5 image – when focused at f/5 – is incredibly sharp! And you can also see that the f/5 image when focused at f/2.8 is actually fractionally less sharp than the wide open shot, which would lead you to believe – incorrectly – that this lens is sharper wide open than at f/5.
By the time the aperture is closed down to f/16, the images have evened out as the depth of field is great enough and diffraction has affected the image so as to make any focus shift have a negligible effect on image sharpness.
As I mentioned above, we’ve only had this lens for a couple of days and we haven’t yet had a chance to run the test at 300mm, but we’ll post the results when we do an overall summary post about this topic with the final test software.
Nikon NIKKOR 50mm f/1.4D
Things wouldn’t be complete with a Nikon lens, so we picked a lens that would be likely to show some focus shift – the 50mm f/1.4D. However, because of the way the new FoCal AF algorithm works, the lens drive hysteresis of Nikon lenses (even SWM lenses) does reduce the effectiveness of the algorithm, so the results are not quite as clean as with Canon lenses. We’re working on algorithm improvements for Nikon and will have it working reliably before release.
The chart below shows some mild focus shift with the characteristic double-peak to the blue line and the gap at mid-apertures between the red and blue lines, but you can also see the inaccuracy in the focus algorithm becoming apparent as the aperture opens wider than f/2.8 (the red line should never go below the blue line).
There are a few points to note from the data above.
Firstly, several lenses exhibit quite noticeable focus shift, like the Canon 40STM, the 70-200 f/4L IS at 200mm and the new Sigma 120-300mm F2.8 DG OS HSM | S. This is in contrast to the popular held belief that only some fairly specialised lenses (e.g. the Canon 50mm f/1.2L) show this effect.
Secondly, the effect is not massive even in some quite numerically significant cases shown above, but it is noticeable and if you’re trying to get the very best from your lenses you may want to slightly rethink how you shoot at mid-range apertures.
So how can you get around this problem? Remember that the focus shift is brought about by the fact that DSLRs focus wide open and then shoot at the selected aperture, so if you were to manually focus with depth of field preview active then you could focus perfectly for the aperture in question. However, in fast shooting situations this just isn’t likely to be a sensible option.
Another possible workaround is to use AF Microadjustment/Fine Tune to shift the focus point a little. This will affect all apertures, so you’ll have to make the decision as to whether you are most likely to be shooting wide open or at a mid-range aperture and compensate for this. However, it’s also quite likely that the focus shift effect is distance dependent (we haven’t yet measured this), so there may be another variable to consider when choosing the compensation value.
Finally, you can tolerate the issue. After all, the overall performance of the lens is based on a whole set of design compromises, and if you want fast glass or small lenses then you may well get some reduction in sharpness in mid-apertures.
The real solution, of course, is for camera manufacturers get autofocus working at the shooting aperture and this may soon be possible with the recently announced advancements in sensor sensitivity.