I have a useful app on both my laptop and phone, The Photographer’s Ephemeris (aka TPE). An ephemeris gives the positions of astronomical objects in the sky at a given time or times. With TPE you can input a location and, for example, the time of sunrise will be displayed along with a map showing where on the horizon the sun will rise. Playing around with this app one evening in my hotel room just outside Yosemite National Park, I discovered that if I positioned myself at Glacier Point, the sun would rise directly over Half Dome. That was a sight worth getting up at 3:30 AM to see!
I set up my camera on a tripod in the beautiful pre-dawn light. To make the shot more interesting, I closed the lens to f/32 in order to generate multiple diffraction rays from the sun. Here is the resulting shot:
This shot turned out pretty much as I had envisioned it. Bright starburst over Half dome with rays of light illuminating the mountains and valleys, fading into the distance.
There was one flaw – severe lens flare. Now some may enjoy this effect, but for me, it detracted from an otherwise romantic scene. But I’m shooting directly into the sun. What can be done?
Then I noticed another image I had captured:
When the sun was positioned on the left side of the frame, the flare extended to the right. When the sun was positioned to the right side of the frame, the flare extended to the left. Could I overlay the images in a way that the flare in the first image would be obscured by the second image and vice versa?
I started by combining the two images into a panorama using Photoshop. Photoshop created two layers which looked like this:
In this image the gray area represents areas of transparency. The black area on the right is the area of the imaged that is masked out. Since the only part of the top layer that shows does not include the area with the flare extending to the right, that flare has been taken care of. Now to get rid of the flare extending to the left, all that needs to be done is to unmask that area of the top layer that corresponds to the area with the flare in the bottom layer. This is done by clicking on the mask of the top layer and painting with a white brush. The resulting layers look like this:
A little more editing to darken the sky and lighten Half Dome and we achieve the final image:
So, in general, one way to eliminate lens flare is to
- take one photo with the sun toward the right side of the frame, one with the sun toward the left side, making sure the area of interest overlaps in the two images
- Create a panorama from the two shots
- Edit the resulting masks to allow the un-flared area of one layer to cover up the flared area in the other.