Masking with your Hand for Shooting into the Sun

Original shot with my hand blocking out the sun



Another shot without the hand, exposed for the sky. Note the flare and lack of contrast in the foreground.



Luminosity channel converted to selection (detail view)



Selection turned into layer mask (close-up view)



The inverted mask itself



The cleaned up mask



Masked hand shot merged with sky exposure

I wrote recently that shooting into the sun can be tricky business. But if you use your hand to block out the sun itself it gets a lot easier. Of course you have to get rid of your hand later somehow to make a useable image. This is where Photoshop comes in. I love shooting images at first light or as the sun sets. But lens flare and low contrast can create real problems if the sun is within the frame. I noticed long ago that blocking the sun with my hand would give me a much better rendering of the foreground, but of course left me with a photograph of my hand in it. If I took my hand away I had an image that in one sense was more usable but in another sense was less satisfying since the now visible sun gave me much greater chance of flare and noticeably less contrast. If only the two images could be combined to give me the best of both. There's more than one way to do this, but the method I'm going to outline here is to turn the bright sky into a layer mask in Photoshop. To do this, you need to take at least two images in the field with your camera. Mount it on a solid tripod so both frames will line up properly with each other. One frame should be exposed for the sky without regard to the foreground. The other should give you the best rendering you can get of the foreground without regard to what the sky looks like or what you have to do to it. Since the sky will be masked out later, feel free to do whatever it takes to get a good foreground. My usual method involves covering the front of the lens with my hand, then looking through the viewfinder and moving my hand away from everything other than the sun itself. The alternative would be to look through the unblocked lens and moving my hand into the frame to block the sun but as I mentioned in my earlier article, looking directly at the sun is something best avoided. When you move your hand around, if at all possible try to end up with your arm and hand not touching the land at all. If it blocks only the sun it will be easier to get rid of later. When you get home, open the frame with your hand in Photoshop. Since Photoshop won't let you create a mask on the Background, check your Layers panel. If you are working on the Background layer, simply double click on the icon for it and let Photoshop convert it to "Layer 0." Now go to the Channels panel. By default, the Red, Green and Blue channels will all be selected. That's the way you want things. Since all three channels are selected, you are effectively working with the composite, or luminosity channel. Down at the bottom of the channel list you'll find a row of small icons for various common tasks. The first one of these will be a dotted circle. If you hold your mouse over it you'll see a pop-up tool tip labeling it as "Load channel as selection." Click on it. You should now see the familiar "marching ants" outlining the brighter portions of your image, hopefully including the bright sky you want to replace. Since we based this selection on luminosity, the bright sky will be selected more than the darker foreground. If we were to convert this selection to a mask now, the sky would be white and those areas not selected would be black. This would give us a mask exactly opposite what we really need. In a layer mask, white reveals and black conceals. Since we want to mask the sky out, we want it to end up as black not white, so we need it to not be included in the selection. To accomplish this, use Select >> Inverse on the Photoshop menus to reverse your selection. Now go back to the Layers panel. At the bottom of the list of layers you'll find a row of small icons similar to what you found in the similar area of the Channels panel. The third icon from the left will be a solid white circle inside a square outline. Clicking on it will load your current selection as a mask. When you do, your image will turn semi-transparent. This might seem unexpected, but don't worry, we're not done yet. If you look closely, you should see that the foreground is more visible than the formerly burned out sky. If the sky is more visible than the foreground, you forgot to invert your selection. Undo things and go back to the previous paragraph. To make your mask more appropriate, it will help to be able to see it more clearly. You can do this by Alt-clicking (Option-clicking on Mac OS XC) on the mask icon to the right of your image in the Layers panel. This will show you your mask which should look somewhat like a black and white negative version of your image. Use the standard Photoshop paintbrush or whatever tools you prefer to paint out the sky to be black and make the foreground white. Much of the work can be done by using Levels to pushing the black point and white point sliders closer to the center. Use a black paintbrush to paint out your hand and arm too so it disappears into the now black sky. What you want to end up with is white where your image had good foreground detail and black where you would rather use the sky from a different exposure. When you are finished modifying your mask, click on the thumbnail for the layer itself to the left of the mask icon in the Layers panel. Now open your sky exposure. Copy and paste it into your working image and move it in the Layers panel to be underneath the masked hand layer. Where the mask is black, your newly opened sky layer will show though. Where the mask is white, you will retain the image on the mask layer. Any mask areas that were between black and white will merge the two layers based on their shade of gray. You may need to tweak your mask a bit to get the best results, but you should be pretty close right off the bat if you prepared your mask as described above. Sometimes a single sky image still won't give you the gradations of tone you are after. A digital camera can capture only a limited range of brightness. A technique I've found works well is to use a composite HDR image for the background sky portion of the frame and single hand-masked frame as described here for the foreground. This gives the best of both worlds  the wide brightness range of HDR for the sky together with the contrast and detail of a traditional image for the foreground. This and other techniques can be combined in countless ways. Have some fun and experiment to see what works best for you.