A question came up on the Alaska Eagle trip about removing an object from its background. I was asked what was the “best” way which is a subjective question of course. What I shared was the most “powerful” way… Calculations. The Calculations command can be used to create a new selection based on the details in an images channels. This technique doesn’t work on all images, but when it does, its a big success.

  1. Open an image that has a complex subject over a background.
  2. Select the Channels panel (Windows > Channels). You need to determine which channel has the greatest differences between subject and background. Because you want mask the background, look for the contrast between the foreground and background. The blue channel should stand out.calculations_Eagle2
  3. Choose Image > Calculations and make sure the Preview box is checked. It’s now time to add one more channel to the blue channel to create a new channel based on the color. This new channel will be the alpha channel and can be used to store transparency data.
  4. In the Source 1 area, set the Channel to Blue. In the Source 2 area, you’ll need to experiment to find the right combination of channels and blending modes. In the case of this image, the red channel is a good place to start, because it looks the most different from the blue channel.
  5. Choose Red from the Source 2 pop-up and click the Invert check box to reverse the details. This will help mask out the bird.
  6. Combine the Blue and Red channels by using Blending. Use the Blending menu, to experiment with different blending modes. Blending are used to control how two different images or channels blend together based on their color and luminance values. Different source images need different modes, so you’ll need to click through many of the modes on the list. You may also want to try deselecting the Invert check box when working with other images. In this case, the Linear Burn mode works well to create a clean matte of the bird.calculations_Eagle3
  7. Click OK to create a new channel in the Channels panel. The channel, should be named Alpha 1 automatically and becomes the active selection in the Channels panel (with the RGB channels turned off, for now).
  8. It’s now time to touch up this channel into a clean black and white mask. This will be done with a Levels adjustment at first. Choose Image > Adjust > Levels or press Command+L (Ctrl+L). Move the White Input Levels slider slider to the left to lighten the gray areas to white. Move the Black and Gray Input Levels sliders to refine the matte and improve contrast between foreground and background.
  9. The new matte is very close and just needs a little touch up. Choose the Brush tool and set the foreground color to white. Paint over any areas that need to be removed from the matte. You may find it easier to zoom in and paint with a smaller brush. You can also run a one pixel Gaussian Blur on the channel with the Filter command.

    Paint with a brush set to white. Zoom in to make it easier.
  10. Once the alpha channel has all holes filled in, Command-click (Ctrl-click) on the alpha channel thumbnail to load the selection. For this image, you may need to choose Select > Inverse to reverse the selection so the bird is active.
  11. Click the visibility icon next to the RGB composite channel to enable it. Click on the RGB composite channel so it is the active channel as well. Look closely at the selection; it should be pretty accurate.
  12. Choose Select > Refine Edge to improve the selection.
  13. Use the Refine Edge command to improve the selection. The Smart Radius option with a low value should do the trick. You can use the other sliders to taste.
  14. Click the Output pop-up menu in the Refine Edge dialog and choose New Layer with Layer Mask.
  15. Click the check box next to Decontaminate Colors and click OK.
  16. In the Channels panel, disable the visibility of the Alpha 1 Channel to see the final results.

Does this method take a little time? Yep… but it gets faster with practice. Of course, quality work is worth a little effort.