Boo's Digital Photography Tutorials.  No. 2

If you'd like to see a larger view of any image, please click the thumbnails and then your browser's 'back' button to return here. Because this site is intended as a photography portfolio, the images are rather large and will take a few minutes to download.

Bypass :: Home :: Water :: Loved Ones :: Birds :: Lake District 1 :: Lake District 2 :: Panoramas :: Black & White :: Flora & Macro :: Live Music :: Miscellany :: Wildlife :: Tutorials :: Badgers :: Mail Order Greetings Cards

Blending exposures using masks

From this . . . . . . . . to this:
  [The original image from the extracted JPEG.]   [The finished image blended from 3 versions of the same original.]

Blending multiple exposures developed from a single RAW shot (or two exposures) can be used to increase the dynamic range available in one single shot. It's a powerful technique that is well worth the time invested. It can also be done using JPEGs very easily too, but the best results are obtained from a RAW original or bracketed separate exposures. The technique involves combining two or more versions of an image to get the best possible range of tones - especially effective for scenes of great contrast or lighting extremes. I perhaps use it most on outdoor scenes where it is all too easy to record the landscape at the expense of a bright sky. My own technique is to expose the scene for the sky or highlight areas - reflections on water etc., which may leave land far too dark, then blend this with a version developed to lighten the dark areas.

I extract/develop two versions of an image from the RAW file, manipulating the Exposure Compensation to extract the detail I want from each (you can do it with more than 2 versions if that's what's required). At this stage, the adjusted image may look wholly wrong elsewhere (over-exposed etc.) but as long as it's correct for the detail you're extracting, the rest will remain unseen. If you're working on a single JPEG, open it in your editor, duplicate it and manipulate the second copy using curves etc. to get the result you want. You will then have two copies of the image open to work with.

[If the lower level and mask are made transparent you can see the hole this creates in the top image.  Note the soft edge to blend well.  ] I open all the required versions in my image editor (I use PSP8, as of writing) and copy one version of the image and paste this as a new layer on top of the other, then manually create a mask by painting on areas of varied transparency as required. The uppermost layer is usually the one that is most right, the lower one may be adjusted for a relatively small area.

  [In the original of this, the darker clothing was a little too dark, this is after blending] A mask is basically a hole of transparency in the top version of the image allowing the other version to show through the hole, improving the exposure in that localised spot. The opacity of the masked area can be varied by 256 levels of transparency that you paint on with a grey scale brush (in PSP this shows red for ease of editing), so the control can be very subtle. Whether I start with TIFF or JPEG copies is irrelevant to the actual workflow at this stage. I paint or fill the areas required then usually gaussian blur the edges to soften any transitions (see the example above), then delete the mask to the top image and merge the layers. I then re-save this blended exposure as a new image.

Creating a mask for complex images:

There are many ways to create a mask and the image itself will determine what is best. For many scenes, simply painting the mask manually allows you to put it exactly where you want it and you can gradually fine tune it to get a good shape and levels of transparency. Sometimes I select an area and fill it, sometimes I use a graduated fill, sometimes a graduated fill within a selection - this is especially good for a sky behind a scene - so you don't get a hard edge where your new sky meets land.

One thing I always do is give it a soft edge - if I'm painting it on, I paint just short of my required area and then gaussian blur it over the 'join' (radius value around 5 to 10-ish) - if I'm making a selection, I always use a feathered edge. This way the blend is much more gentle and the edges much less perceptible. The more subtle your adjustment, the less critical your mask edges need to be. You need to be most careful if the difference between the layers is very distinct and any hard transition between them is more likely to show.

Some scenes are simply too complicated for a hand painted or filled mask to be sufficient, where trees overlap sky for example and there are various ways you can automatically create a mask from the image itself - which often needs further modification or tweaking - they nearly always need some degree of individual attention to get a really good, natural looking, result. One of my current favourite techniques is to extract one of the colour channels from the image. These are a monochrome image representing one of the colours in the image and as such make a good basis for a mask. My own preference is to split the image to CMYK and often either the black and yellow channels make the best basis for a mask, depending on what you want to mask out - probably most often I use the black channel from CMYK and this often needs converting to a negative to get the detail in areas you want.

A channel image of this nature, split from either CMYK or RGB, will contain a lot of unwanted detail in the mask, but as it's a monochrome image, it can be edited just like one. I often find that using a curve adjustment to lighten will remove the unecessary pale grey textures and details in lighter areas, leaving only dark details that will be good for a mask makes a good starting point. Once you feel the channel image looks like it will make a good mask, just try it - create a mask above your two images 'from an image' and select the channel image. Have a look at the result and if it isn't quite what you want, undo the mask, tweak the channel image and try again. Using an automatically created image like this for a mask often needs two or three attempts until you get the result you're after.

A working example:

  [The original image from the extracted JPEG.]  This is an example worked using just such methodology. The scene, shown left, was taken from under trees on a bright summer day and the distant landscape, lake and sky through the trees was consequently over-exposed and the woodland foreground rather too dark.   [The three frames used in the blend. ] Two frames were developed, one each for foreground and distant landscape and sky and in fact a further frame was created from one of the JPEGs (only partially shown) to lighten the single main tree as I decided this looked too dark part way through the process. A screen shot of the three frames used is shown right.

  [A negative of the black channel after moficiation as a mask.]   [The images layered with the mask showing on top.] I split one of the images to CMYK and decided the black channel looked best as a basis for a mask, due to the complexity of the leaves over the sky area. On trying this, the detail in the foreground wasn't needed, so I simply painted over the entire area with black paint and tried it again. You can see how the mask overlaid the image and which areas it was to mask out beneath it - showing as red in PSP. I was in fact using a negative of the black channel - which actually looks like a positive image. Had I placed the light and dark layers I was blending in reverse order, I would have used the original channel image which actually looks like a negative.

In summary; the bit you want to make transparent in the top image - to allow the other image to show through from the layer beneath it - needs to be black in your mask image.

It doesn't matter which way round you use the layers and which bit you mask - generally speaking I work so that the easiest and/or smallest area is masked out, for ease. In this instance it was about half and half and I just worked the images in the order they presented themselves to me on screen.

  [The finished blended image.]  Once you have your mask in place and preview the results by swtiching the visibility of the various layers on and off, you can make adjustments to get a result that pleases you. As mentioned, a modest gausian blur to the mask layer will soften the edges of the blend and can prevent rogue pixels appearing at edges of delicate details, like where the leaves overlap the sky. There are various adjustments you can make - you can still edit the mask in position, if the effect looks too harsh, you can lighten it with a curve, or adjust the transparency of the mask layer. You can also adjust the transparency of the uppermost image layer if the effect requires more subtlety.

When you're satisfied with the result, merge all the layers and make any further adjustments to the image (saturation, contrast, sharpening etc.), remembering to save it as a new image and not to overwrite one of your frames.

If you found it useful . . .

Boo's digital photography tutorials are provided free of charge for fellow photographers, but if you found them useful and would like to make a small donation to the upkeep of the site, you can do so using PayPal by clicking the button to the right. Thank you.

Back to the Tutorials menu

© 'Boo. 2002 - 2005. All rights reserved. ~ Site content must not be used elsewhere without consent.