removing a lens flare

Intro: This quick-tutorial explains how I removed a lens flare from an image using gimp 2.3.8 from cvs (the procedure would be the same on gimp 2.2.*, but the location of the tools on the menus are different). This turned up on a message by Joey Morris (who also sent the image!) to the gimp-user list.

The idea was to transform this:
So that the hexagonal lens flare on the center portion of the image would vanish.

There is no exact procedure on how to do this kind of stuff. That is exactly why I usually just go along trying things until I get a result that satisfies me. In this case the first thing I did was a selection around the affected area:

As you can see, the selection is very coarse and needed to be made a little better, I was kind of lazy and used [select->grow] to resize it and make it some 10 pixels bigger:

I then poked around with colour adjustments to correct the colour. That had no effect, since the pixels inside the selection had a 'big' range of coulor values. I 'corrected' that using [colors->map->colormap rotation] by transforming most of the blues and some green/purple into yellow:
The resulting image was this:

Then I had something more uniformely colored image to work with. I felt that changing hue and saturation on this whole selection would give me too much trouble later. So before I went on I used gimp's quick mask to make the selection more precise:
As you can see it could have been even more precise, but I was in a hurry!

Now I was going somewhere. I then tweak the [colors->hue-saturation] controls until I got something that blended with the rest (unlike the ugly yellow I had before):
You can now notice how the spot has almost the same color 'feel' as the surrounding areas. The values I used for the hue-saturation controls were (more or less):

This was much better than before, but there were still some marks of the 'hexagon'. Especially because of the bad selection I made before. The final touch to remove these was made using the clone tool both with 100% opacity and some lower opacities to give it a more natural blending with the surroundings. The intermediate result was:

After a few more clones I finally got rid of the hexagonal flare:

Conclusion and next steps: With more time the cloning could have gone much further and an even more uniform image could be achieved (especially if I tried to 'prolong' the sun rays on the upper part of the branch cutting through the hexagonal flare). There could also have been greater care with maintaining the patterned detail on the building behind the flare.

With a higher resolution image (as the original probably is) there is room for much better results.

Another thing that could be much improved is the initial selection on which I worked, if I had it perfectly right from the beginning, then the cloning would be much easier.

back to main