ettoremarzocchi.com - Photography and Computer Graphics Resources

Saturday 13 March 2010

Web www.ettoremarzocchi.com
  • English
  • Italian
Home arrow Tutorials arrow Photoshop arrow Difficult Background Removal
Difficult Background Removal

INTRODUCTION :
In this lesson we are going to explain all the required passages to isolate the main subject of a picture and isolate it from the rest.
The photo we are going to retouch is the following:

Original Photo

You can use the same photo to follow this tutorial, just click to see the larger version and download it (right click -> save as...)

The goal is to remove the sky and the sea and leave the wave and the rocks.
We are dealing with a pretty difficult main subject to cut away. The wave has a very irregular and not so sharp border in most of its length.
Furthermore the water in the uppermost part of the wave is only a thin layer and thus allows the light to come from its back. This means it's also slightly transparent.
Because of all these factors the traditional polygonal or magnetic lasso tool is not probably the best way.

CHANNELS:
In Photoshop you have the great chance to use channels as selection masks.
To better understand what Photoshop Channels are and how do they work we suggest you to take a quick look at our guide:

Photoshop Channels Revealed

Channels Revealed Icon

before you continue with this tutorial. 

LET'S START:
OK, so first thing to do is to open your Channel panel and to check all of the tree RGB channels.

Image Channels

To extract the main subject you'll have to find and start working with the channel with the greater contrast between background and what you're going to cut away.
In our case the best one is the first, the R channel.

To start working on this channel we duplicate it in order to keep our image information intact.
To duplicate a channel just drag and drop it in the "New Channel" button at the bottom-right part of the Channel panel:

Drag Channel

 

(otherwise you can right click and choose "Duplicate Channel..." from the context menu).
Your new channel's name will be Red Copy. You can rename it by double clicking on its name or leave as it is. Doesn't matter for our purposes, but remember, if you work with many channels you better give them a meaningful name to ensure a more organized workflow. (Just like you'd do with Layers).

As we explained in our Photoshop Channels guide, a channel is just a greyscale rapresentation for a selection. The wave, which is white is selected, while the deep blue sea in the background, which is rendered almost black on this channel is almost completely not selected.
That's a good start,  but we have to work on it to make it fit our needs.

In order to improve the contrast open the Levels panel ("Image -> Adjustment -> Levels..." or Ctrl-L for the keyboard shortcut)
This panel shows the image histogram and let us adjust the image brightness.

 Levels Panel


We are now going to shrink the black and the white sliders pretty much toward the middle tones, this way we are going to make the darker tones even darker (towards black) and the lighter tones even lighter (towards white).
We used input levels values: 127 - 1.19 - 164.
If you keep checked the Preview you'll see the modifications live while dragging the cursors back and forth.
Now just press OK and you should have something like this:

Levels1 Applied

We did a good job, the wave now stands out much more than before and the background is almost black, meaning it's not selected.

But we still have the rocks pretty dark and we want them also as part of the main subject.
For the rocks it's just a polygonal lasso tool dirt job: the outline is sharp and we're going to spend few seconds tracing its boundary.
The part below the wave it's a loose selection, we don't need precision as we can pass through the already white zone. We need to be accurate only in the leftmost and the rightmost part, where there's a direct contact between the rocks and the background.
Here's our selection (after lasso tool a 2 pixels feather selection was applied to soften it a little bit):

Selected Rocks

The selected part is something that we want to add to our selection (along with the wave), so we just take a big brush, white color and paint it in a couple of strokes.
Then deselect all (Ctrl-D) and check if everything is ok. Correct with the brush everything you don't like: small clusters of black pixels in the zone that should be white, rocks boundary has to be smooth etc.
Now we just delete the clouds and most of the sky (still dark grey) with a black brush and in few stroke and no efforts you should get here:

After brushing

That's getting a cool selection mask. As you can see we have a complete selection on the rocks and on the main part of the wave, the background is dark and we have a perfect tracing of the water border. Note that along that border we don't have a black-white transition but we have also grey, meaning that once we load that mask that part will be slightly transparent as we want it.

Now, just to be sure the sky is completely black we apply once again a layer adjustment. Much milder this time, just to be sure that we are not going to select anything from the background.
In order to have also a softer selection we are going to apply to this mask a Gaussian Blur Filter:
Go to Filter->Blur->Gaussian Blur and set the radius to 0.8 pixels.

Gaussian Blur

Note: you can apply a number of filters on channels, just play around to check what you can do!

OK, so now our selection mask is ready.
Simply Ctrl-click on the thumbnail of this channel to load the related selection.
(you can otherwise go to Select->Load Selection... menu and choose the channel you want to use).
You'll see the ants running on the 50% grey transition.
Now that the selection is loaded we can go back to the original image: click on the RGB channel.
Click on the Layers tab and create a new layer with the selection (Ctrl-J or copy/paste... it's up to you).

New Layer

If the above is your actual configuration you'll see no changes in your image. That's because we still have the background layer.
So, create a new layer and put it in the middle between Layer1 and Background. Fill the new layer with some color and see the result:

Red Background

We successfully selected our wave!!
Now it's just up to you, choose the background you prefer and keep playing aroud!