I am just post-processing some pictures I took last spring. On lots of them, I notice a halo around the edges of objects which are slightly outside the focused depth.

I shot without a tripod, with the Nikon 18-200 lens, but had stabilisation turned on. Maybe the problem is that the camera trembled in my hands while shooting, but the focused objects look sharp enough to me.

I don't think these can be removed in post processing, but if yes, I would like to hear how to do it. If not, I would like advice on how to avoid it next time I am shooting.

The whole image:

alt text

An edge sample at 100% scale. Note that the problem is present with the edges of the stem and the petals of the flower in the background, but not on the edge of the flower in the foreground.

alt text

The image has been through some heavy color post processing in raw, but no editing outside of that (especially no sharpening, which Google suggests as a common cause of edge halos).

Edit: to make it clear, because most answers seem to assume that I don't like the fact that the background is unfocused because it is outside of the DOF. I am aware that the petal which is outside of the focused depth will always be blurred. But I was expecting a more gradual blur, not this "second" edge. An example where there is blur but no halo:

alt text

This is from another photo taken in the same session. Again, there is a petal which is in focus and has no blur or halo, and a petal behind it. The second petal is outside of focus, so it is blurred as expected, but does not have this funny effect as in the first picture.

  • 2
    What aperture, focal length and focal distance did you use? Nov 25, 2010 at 0:51
  • @drfrogsplat 5.6, 1/40, 200 mm (this is a DX lens, so 300 mm equivalent). I don't remember the focal distance and it seems to be missing from the EXIF, but the minimum of this lens is 50 cm and it probably wasn't much more than that. Same stats apply to the second sample (without edge) I posted in the edit, but the distance would be bigger, maybe over a meter.
    – rumtscho
    Nov 25, 2010 at 22:06
  • So the DOF calculator I linked to in my answer can't even provide a DOF for that shot because it's less than its 1cm limit of accuracy (: Nov 25, 2010 at 23:29
  • keep in mind that DOF calculations use the real focal length, not the 35mm "equivalent".
    – Reid
    Nov 30, 2010 at 16:38

6 Answers 6


It's called spherical aberration. As mattdm says, more complex lenses (especially superzooms) need more compromises than e.g. simple compound primes so they often show more defects. If you want 'better' bokeh you'll have to use a different lens. Personally I don't mind that effect much but the point is that it's intrinsic to your lens.

  • 1
    My second example shows that it is only present in some pictures, but not in others. So while it might really be a lens defect, it doesn't always affect a picture. I hoped that there is some common knowledge how to make photos where it is not present.
    – rumtscho
    Nov 25, 2010 at 22:22
  • 1
    +1 looks like uncorrected spherical aberration to me - toothwalker.org/optics/spherical/crosses.jpg the character of OOF regions varies depending on whether you are in front or behind the plane of focus. This might be why the effect only appears sometimes.
    – Matt Grum
    Nov 25, 2010 at 23:47
  • Yes, I read on it, looks like you are right. I also found some advice: not shooting at max aperture should mitigate it. I'll try it out next time.
    – rumtscho
    Nov 27, 2010 at 8:55

In the example here, I think you're actually at the limits of the depth of field, and the rear petals are actually out of focus -- I say this as the foreground petals don't exhibit the same effect, and the focus seems to be on the trumpet of the daffodil.

A narrow aperture when shooting will increase the depth of field, and increase the area that is apparently in focus -- however, this also runs the risk that the background will appear to have less blur, which I'm guessing was an effect you were trying to achieve here.

  • This would be my guess too; superzooms often have quirky bokeh. You could narrow it down by shooting a focus testing chart at the same aperture and looking at the character of the bokeh - if it looks similar, that would confirm.
    – Reid
    Nov 24, 2010 at 22:01
  • 2
    I'd agree as well. At a rough guess I'd say it was shot at 200mm, f/5.6 from about 2 metres away on a Nikon DX camera. This would give a DOF of 1 cm either side of the focal plane. If it was f/11 it'd be 2 cm either side. The rear petals look to be more than 2cm from the front ones. Nov 25, 2010 at 0:56

This is a super-zoom lens going all the way from wide angle to quite close. There's going to be some compromise, and having the out-of-focus areas be a bit less than ideal isn't really surprising.


Check out a Depth of Field (DOF) calculator like this one, and you'll see that with long focal lengths your DOF will be very small, even at f/11 or f/16 when you're up close.

Depending on your lens, you might find that you get a higher DOF (for the same subject magnification) if you go a little closer and reduce the focal length. This obviously depends a lot on the lens and its minimum subject distance.

For these types of shots, it's very useful to have a good idea of how much DOF you can get from your various lenses at different ranges (at least at the shortest or most commonly used ranges) from various apertures.

You could perhaps make a small table of the various focal lengths your lenses offer (or their limits if they're not primes) and the DOF for a few different apertures at a few different distances. It's a bit hard given it's a problem with 3 dimensions (aperture, focal length, subject distance) and only a 2D table, but even just knowing the limits at a few different ranges will give you a fair idea before you take the shot.

  • Very useful information, thank you. And I think you have given me the perfect idea of how to get my hands dirty with mobile applications. I wanted to try writing something for my phone anyway, and such a calculator seems useful and easy.
    – rumtscho
    Nov 25, 2010 at 22:19
  • I've got a couple of those apps on my iPhone, and while useful, it'd be more useful to me to have simple graphs to look at — I think graphs would make it much quicker to pick your aperture based on the lens + distance for example, or better still, to be able to remember the graph in your head after using it enough times (where a calculator doesn't really help you remember anything other than the 1 specific sample) Nov 25, 2010 at 23:28

As others mention, this looks like simply out-of-focus rendering. It is not a bad thing per se. You can use this effect artistically. However, in macro shots the depth of field is very limited (depends on the aperture, the focal length and the distance to subject). So if you want to take a sharp image of a bigger subject, this may be difficult or impossible.

However, there is a technique which allows to take a sequence of shots with different focusing distances and then merge them together in a single image with higher DoF. This technique is called

Focus stacking

It is a post-processing technique used to increase the depth of field using several images. There is a number of software packages capable of focus stacking. The free ones are:

enfuse with Hugin's align_image_stack. Ascetic command line tools, but they should work. Check this tutorial.

ALE, synthetic capture renderer. Can do also focus stacking, according to Wikipedia.

Stack Focuser and Extended Depth of Field plugins for ImageJ.

CombineZP (Windows only).

Wikipedia reports that Photoshop CS4 can do it too.

  • While this isn't directly what I meant (I didn't want a bigger DOF in this picture), I find your post highly informative. I didn't know such a technique existed. Thanks.
    – rumtscho
    Nov 25, 2010 at 22:10

In my experience, its often due to over-sharpening in my photo editor. Even over-processing in general. Sometimes I can mitigate it by reducing highlights and/or whites. But generally, I just trash the photo rather than try to save it. I always take several of any shot. Some are good, some aren't. Even with perfect exposure, it's a crapshot I think.

  • The OP specifically discounts over-sharpening: "The image has been through some heavy color post processing in raw, but no editing outside of that (especially no sharpening, which Google suggests as a common cause of edge halos)."
    – scottbb
    Aug 10, 2017 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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