I enjoy visiting a good aviary to capture birds, but often they are caged. My strategy is then to move as close as possible to the fence, resulting in a blurred fence foreground and the subject in focus:

enter image description here

Still, often the blur lines are clearly visible, which I then try to reduce or remove in post processing. And that's what my question is about...are there are any best practices and effective techniques to get rid of this foreground fence?

  • \$\begingroup\$ This concerns a Nikor 18-105mm F3.5-5.6. \$\endgroup\$
    – Fer
    Commented Mar 25, 2012 at 10:51
  • \$\begingroup\$ Thanks on the similar question, although I think this one is slightly different as it does not concern glass. With glass you may get lucky, for it being clean. With a fence, no matter how close you get you will always have it in the foreground. \$\endgroup\$
    – Fer
    Commented Mar 25, 2012 at 10:55
  • \$\begingroup\$ @Ferdy - se my Toucan photo ! :-) \$\endgroup\$ Commented Mar 25, 2012 at 11:47
  • \$\begingroup\$ Ferry I think this is a great photo by itself (without any post processing) \$\endgroup\$
    – Janardan S
    Commented Aug 10, 2016 at 13:57

3 Answers 3


This is a "preprocessing" answer based on my answer to a recent question by @Brandon K about lens effects.
This relates to the "anti-focusing" of objects closer than 1 focal length to lens:
Stopping the bars being visible saves needing to try a difficult post processing job.

In the diagram below (submitted by original questioner, modified by me) it can be seen that objects which are closer than one focal length to the lens are NEVER focused - they are "defocused" with their image being dispersed and spread out across the picture - in some cases to create the blur lines that you see.

  • The biggest "trick" is to get the bars or mesh as close to the lens face as possible. Against the glass is ideal but is obviously dangerous to the health of the lens.

  • Set lens to maximum aperture. A lens with a large maximum aperture helps. I get good results at f1.8 as with the green and orange bird below BUT the black/white /orange Toucan was shot at f6.3.

  • Longer focal length helps - both to reduce depth of field of the subject but also to give a greater distance between focal point and lens.

  • Having the subject close but far enough away that the depth of field does not extend anywhere near the bars helps BUT most birds are not liable to cooperate.

The original questioner @Brandon K provided the diagram below and asked or suggested that

  • ... it seems that close objects shouldn't even appear on film based on the diagrams.

  • "Anything close enough to form a virtual image is not focused onto the focusing screen"

What he and you describe happens, but because the defocusing of objects closer than a focal length from the lens is progressive as distance inside the focal point increases - just as the diagram suggests - they do not just "vanish" as they come inside the critical distance - rather they become progressively more indistinct the closer they get to the lens face.

The pictures below show reasonably extreme examples of this 'feature' being used to good effect to nearly completely remove closeground items from the photo. Foreground objects (in this case a heavy mesh and cage bars) which are closer to the lens than its focal length are "anti-focused" to the point of near invisibility.

Diagram below from Brandon modified by me - cage bars and lens focal length added:

enter image description here

See sample photos

This is one of my standard "tricks" for photographing objects in cages and similar environments where there is an incomplete obscuring layer that you can get right up against. An extremely useful "trick".

In this photo there are cage bars very close to the front element of the lens - as close as I could get them. I use this method to sucessfully "drop out" even quite solid bars. In this case it's normal thickness cage bars. Distance to front element is under 50mm and it's a 50 mm f1.8 lens. There ARE some optical effects present but they are not normally noticed by most viewers. Higher res version of this is here and click download icon 2nd from right at top of photo. This gives a much better look at what you CAN'T see.


enter image description here

This is an even better example, in that there is a small pitch very thick square mesh between the camera and the subject (I think not more than 20mm squares - I can check other photos). This was using an 18-250 lens at 18mm, f6.3 * See photos showing mesh that was present in 2nd photo below. Visually the mesh ruins the bird's presentation and the camera "sees" the bird far better than the eye can.
Same photo on facebook here


enter image description here

enter image description here

(*) I originally said that this was taken with a 50mm f1.8 lens but after checking the original I have changed the details, as above.

  • \$\begingroup\$ The first picture is great! \$\endgroup\$
    – Joanne C
    Commented Mar 25, 2012 at 14:00
  • \$\begingroup\$ Fantastic answer, thanks so much! I fully agree that the preprocessing approach is better than post processing. It does seem my kit lens may be a bit of a bottleneck as it comes to maximum aperture at full focal length :) \$\endgroup\$
    – Fer
    Commented Mar 26, 2012 at 6:58

And for a completely different approach, if you cannot blur the offending wires enough by lens placement and aperture selection, then try for the extreme opposite. Change your setup so that the foreground wires are as sharp and crisp as possible. And then go through and use something like the spot healing brush in photoshop to get rid of them. By putting them in sharp focus, you'll lessen the size of their interference.


Just to see how well it would work, I had a go at removing the fence from your sample image.

Don't get me wrong: prevention is way better than cure. I did this mainly for curiosity, and just in case you had an image that already had this issue and re-shooting was not a possibility.




  1. I gave it an overall contrast boost. You can do this with curves, but I did it by duplicating the layer and setting the top one to "soft light", then adjusting opacity.

  2. I created a selection in the rough shape of the fence obscuring the bird.

  3. I feathered that selection by 200 pixels.

  4. I gave the feathered selection region a contrast boost. Again you can do this with curves, but I duplicated the base layer, cut out the non-selected area, and set the upper layer to "soft light" mode.

I didn't do it perfectly and you can still see some areas which weren't fixed.

  • \$\begingroup\$ An excellent improvement. The contrast boost makes sense, yet steps 2-4 are interesting to play with, thanks! \$\endgroup\$
    – Fer
    Commented Jun 30, 2015 at 18:00

Your Answer

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

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