a12 August 2013

Tutorial: dealing with lens flares

Above photo was treated with technique described in this tutorial
When I was taking some snapshots as a kid a lot of people told me not to point the camera in the direction of the sun. And I listened (I was that kind of kid which sometimes listened to those older than me). But many years later when I started photographing for serious I quickly learnt that pointing my camera in the sun is actually one of the easiest ways to get some amazing light. Especially during sunrise or sunset when light passes through a lot of particles creating beautiful phenomena like haze or sun rays (known as God rays, light shafts or light beams). Or also during blue hour when strong light sources turn into some amazing stars.

But there is indeed one thing that is very very bad about shooting into the sun. Flares. Those nasty red, yellow, pink or green spots, dots or bows you get in the image if the sun (or any strong light source in fact) is in the frame.

This might not be that bad in some cases (eg. it might work in some portraits adding some extra interest to them) but usually for a landscape photographs it doesn't look good. It looks ugly.

In this tutorial I will try to share a few tips on dealing with lens flares: from avoiding them to removing them at the post-processing stage.

Avoiding lens flare

So let's start with some tips on how to actually avoid the phenomenon of lens flares as it's always easier to do this in camera than later in post:
  • avoid shooting into the sun or any direct light - it's quite obvious but it's not always possible. Also it's very limiting
  • try to shoot from the shade - this way no direct light falls on the front element of your lens 
  • use the lens hood - to limit direct light falling on your lens
  • use prime lens - they have less optical elements and so they are less prone to the flares
  • avoid using to many filters or at least make sure to use coated ones - each lens is another optical element what increases a chances of lens flares to occur.
  • block the sun - you can use compositional elements like trees or buildings to reduce the flares. Just put them so they completely or partially cover the sun
  • try different focal lengths and apertures - flares often behave differently depending on the focal range of the lens as well as selected aperture. Often flares are looking better if you stop down your lens to f/8 or f/11.
But sometimes avoiding the lens flare isn't possible. In such a case you have to employ different strategy.

Hide the sun

In the tips above I mentioned blocking the sun. If you have no compositional element to do this or you prefer to see the sun in your shots there is similar technique but it requires a bit of post processing.

1. First take two shots. First one should be normal i.e. with sun visible in the frame. In the second photo make sure to block the sun with your palm (or finger, some object etc.). Make sure it has the same exposure parameters as the first one. For that you can either use Fully Manual mode or use Exposure Lock feature of your camera if you're shooting in Aperture Priority mode (Av or A).

2. Then back in Photoshop just blend the images in such a way that no flare is visible anymore. First identify the flares. In the image below I marked the ugliest with red pen:
  1. Open both images as layers in Photoshop making sure that image with your hand in it is above the other one.
  2. Create layer mask for the top layer and fill it with black.
  3. Select brush tool, set it opacity to around 25% and its color to white.
  4. Paint your layer mask over the areas where you notice flare artifacts. For my image I used following layer mask:

As you can see this mask is white in the lower part of the image and also where the tree is, meaning that in this parts data from flare-less image is used.

There is one problem with this method however. It's quite difficult to use if you're using long exposures. Keeping your hand steady for 1/100th of a second or 1/4th of a second is easy. But keeping it steady for 30 seconds is definitely not.

Removing the flares in Photoshop

It might be not the easiest and quickest tasks but it's definitely possible. The key is to use a combination of Hue/Saturation adjustment layer and Clone tool.

I used this technique for example in the photo below.

 And it is how medium exposure photo looked before:

What I basically did was to first do some cloning to remove the flares in the rocks in the lower right as well as some in the clouds. I also used Hue/Saturation adjustment layer which was black apart from the regions around the sun. Reds saturation and lightness was significantly reduced to make it blend with the image better.

Post a Comment