How to Create Masks of Transparent Elements in Photoshop

How to Create Masks of Transparent Elements in Photoshop

Tutorial Details
  • Program: Adobe Photoshop CS5
  • Difficulty: Beginner
  • Estimated Completion Time: 30 Minutes
Download Source Files

Final Product What You'll Be Creating

Selections are an essential part of any photo editing workflow, but often, selections aren’t as straight-forward as they might seem. In this tutorial we will explain how to make a selection of a glass that includes transparent elements. Let’s get started!


Tutorial Assets

The following assets were used during the production of this tutorial.


Step 1

Selections are an essential part of the image editing process in Photoshop. The process of making a selection is easy but sometimes transparent areas can make the process a bit more complicated. For these types of project, the pen tool is not sufficient. To select areas with a variable level of transparency we need a tool or command which will let us manipulate the brightness information of the color channels of that image. Because we are not only interested in creating a simple cut-out, rather we are more interested in creating a mask, where we can store variable level of brightness information for defining that complex level of transparency. As a channel is just a grayscale image we can use that channel effectively to create a mask, because a mask also uses grayscale (pure white=100% opaque and pure black= 100% transparent) to store transparency information.


Step 2

One of the major advantages of having access to the separate channels in Photoshop is the ability to make selections. You can use individual channels to make different selections in the image. When you want to select a specific item in the image, use the color channels that provide the greatest contrast around the edges of that item. So let’s start the initial planning phase.


Step 3

This is the original image. Though this is a CMYK image, same process will work in case of an RGB image. Only difference will be in the Channels panel. Instead of four color channels and one composite channel, there will be three color channels and one composite channel in the RGB image. The objective of this tutorial is to remove the black portion but to keep the glass, water, bubbles and the reflection below the glass. So we can use it on any other background (Solid color or photo). For this tutorial we will use Apply Image command (Image > Apply Image).


Step 4

The Apply Image command lets you blend one image’s layer and channel with a layer and channel of the active image. But remember the pixel dimensions of the images must match for image names to appear in the Apply Image dialog box. But here we are not using two images. We are blending the black channel copy with the black channel copy itself. But the power of the Apply Image is hiding within the Target section. Here you can specify a blend mode or blending type which you want to use during the Apply Image blend.


Step 5

Open the file in Photoshop. Then in the Channels panel examine the channels for a channel with good contrast. Finding a channel with good contrast is essential for good selection.


Step 6

Here the black channel is showing good contrast between the glass and the background.


Step 7

Duplicate the black channel by dragging it over the ‘create new channel’ icon below the Channels Panel. You can also right click on the black channel and select duplicate channel.


Step 8

Then select the black channel copy and Image > Apply Image.


Step 9

First blend one time with Multiply mode to increase black and in this process convert from the background any area to black which is gray. But reduce the opacity (within the Target section) amount to 50% to create a blend which is not too strong. Otherwise we might remove some white areas, as they are not pure white.


Step 10

The Multiply blend mode looks at the color information in each channel and multiplies the base color by the blend color. The resultant color is always a darker color. Multiplying any color with black produces black. By using the Multiply blend mode we are removing any grey portion from the background.


Step 11

Then blend two times with Overlay blend to increase white. Now we can easily select the white area. Our goal here is to create an effective, fast and acceptable mask with this process. This time use 100% Opacity in the blending area.


Step 12

The Overlay blend mode multiplies or screens the colors, depending on the base color. The base color is not replaced, but mixed with the blend color to reflect the lightness or darkness of the original color. White areas become brighter and black areas become darker. By using the Overlay blend mode we are increasing the strength of the white portion as we want to keep the white portion but mask out the black portion in the final image.


Step 13

You can still tweak the black channel copy by using a brush and paint with white or black color. Paint with white to keep image areas and paint with black to remove or mask out portion. White denotes opaqueness and black denotes transparency within a channel.


Step 14

Load the black channel copy as a selection by either Command/Ctrl-click on the channel or click the first button below the channels panel, which is load channel as a selection.


Step 15

Then go to the Layers panel and duplicate the background layer by dragging it over the create new layer button below the layers panel. You can also right click on the background layer and select Duplicate Layer.


Step 16

Then target the new layer (Background copy) by left clicking on it once. Selection still active, click on mask icon below the Layers panel to create a mask.


Step 17

Now create a new blank layer below and fill it with either red or blue. Now check the quality of the mask. You will find that within the mask there are few grey areas.


Step 18

There are two processes to remove this unwanted grey area. Although first process described below will give you the best output, but still let’s explore both of them.


Step 19

Process 1: Change the blend mode of background copy layer to Lighten in order to remove grey area.


Step 20

Lighten blend mode looks at the color information in each channel and pixels darker than the blend colors are replaced, and pixels lighter than the blend color do not change. As a result dark grey pixels removed.


Step 21

Process 2: Command/Ctrl-click on the background copy mask thumbnail to load the mask as a selection. You can also load the selection from the black channel copy.


Step 22

Then click on the Adjustment layer icon below the Layers panel.


Step 23

This will create a new Levels Adjustment layer.


Step 24

Then in the levels dialogue box first drag the midtone input slider (middle one) and then the highlight input slider (right one) towards left to remove grey area or rather converts grey into white.


Step 25

After applying Lighten blend mode, if you check closely you will find that there are a few broken portions within the white area. You can use the Clone Stamp Tool to fix these areas.


Step 26

That’s it. You can use the same technique to select complex objects with variable level of transparency. Below is the before and after version.


Final Image

This is the final version.

  • chris

    just a suggestion.. its terribly confusing the way you have this written. step 5 is actually step 1. steps 1-4 should really just be an introduction paragraph or two, not steps.

  • Captain Betty

    Great article and technique…

    The Level adjustment option is good, but you could also use the layer’s BLEND IF GRAY and adjust from the left a bit – or split the slider (alt+drag).

    The level option will give you a great contrast…

  • tvandang

    Arindam,

    Wow, I need to look more into blending mode and channels. So powerful piece of information you are giving me today about overlay, lighten, and mulitply mode. I had no problem following your flow of instructions. That was awesome. Great job and thanks for the tutorial.

  • http://grafixity.com Grafixity design

    Informative tutorial. Though I kind’o have to agree with chris here. Though I don’t necessarily believe that step 5 is actually step 4…just a longer intro would have cleared things up a bit,making fewer steps. Nevertheless this free info is a gem for anyone experimenting with blending mode options. Thanks for the tut.

  • mellofilipe

    Nice Tut, but in my opinion it would be easier applying curves after duplicating the black channel.

  • http://RelativeState.com Nick

    Nice Tut, Thanks for the effort, makes me wanna shoot something to play with just like this… I appreciate the effort!

  • Farand

    Ummm… why should i need cs5 to do this?

    • http://www.kieru.com Rob

      I have a feeling the version number was provided more as a reference for what was used than as what is necessary. Each iteration of Photoshop has slight UI alterations so providing the version can help clarify discrepancies between screenshots and your own UI experience.

  • amir

    Yaa,
    Informative tut for blend,

    best of luck

  • http://www.mashdesigning.com Ifham khan

    Great one, will work on it for more nice effects

  • http://www.cgvector.com cgvector

    WOW! The Level adjustment option is good,

  • http://betterhtml.com/ Andru Stoicescu

    Vey nice tut. Great technique!

  • tom

    Great to see using a channel’s grayscale values as a layer mask – my all-time favorite trick — but the rest is way more complicated than necessary. I would just load the selection, then immediately make a solid red layer, so it will apply the current selection as a mask. What the channel showed as dark is now transparent, and light as opaque. Reverse the mask (command-I) so that the red layer looks positive instead of negative, and then use Curves (never Levels!) to adjust the contrast in the mask to your liking. Curves gives you all the capabilities of those unnecessary steps, all in one easy-to-tweak step. Throw a solid white layer behind the red one and you’re done.

    Why do I say “never Levels”? Levels gives you control only over the white point, the black point, and the grayness of those extremes. The equivalent in Curves is merely moving the end points of the curve up, down, in or out, with none of the infinite control over gray-value contrast that applying a nice S-curve gives you.

    • http://radesign.in Rakesh

      Readers of this article would do better to ignore everything after step 6 and read Tom’s comment instead. Great point, Tom.

    • Bullwrinkle

      Shouldn’t the phase “none of” from the last sentence be dropped to imply “all”

  • http://www.clippingphoto.com Golam Rahaman

    Really helpful nice transparent Elements tutorial. Thanks.

  • Plots

    very nice tutorial thanks i think its backwards compatible with CS4 because only the clone stamp that would perhaps not work the same…

  • Dan

    i really don’t see any difference, it looks the same

    • http://www.preisvergleichstromanbieter24.org benn

      And that’s what it’s supposed to!

      “The objective of this tutorial is to remove the black portion but to keep the glass, water, bubbles and the reflection below the glass. So we can use it on any other background (Solid color or photo).”

  • The Beast

    well , that was great :)

  • http://www.psd-dude.com John

    Nice tips, I am learning something new every day :)

  • Trung Nguyen

    Thanks, that’s great tips :)

  • Nishad

    Thanks

  • Nishad

    Great talent..Thanks

  • http://gravatar.com/kanad9 James Moore

    I think we are overlooking the real purpose. He probably wants to introduce the Apply Image Command to the beginners. Apparently Apply Image is simple command, but if you really want use it’s power then higher knowledge of channels and blending modes needed. Not much info is available regarding Apply Image and Calculations – the two very mysterious commands of Photoshop. So I thank him a lot for sharing.

    @Captain Betty – Blend if Grey is not a beginner thing. It is itself capable of a complete tutorial. That’s why not much info is available about it on web. Never read anything beyond the basic description about it. Same thing is true for that knockout option also.

    @Tom – Curve is not a beginner level command. Curve is one of the most complex commands available within Photoshop. It is clearly mentioned above that this is a beginner level tutorial. I think that’s why he purposefully avoided that and choose Level, which is more suitable for the beginners. One more thing Tom, please read whatever you have written as the proposed alternative steps. They are not making any sense. Red layer is not important here. This is I think just to check the quality of the mask / selection.

    @Rakesh – Did you try the steps mentioned by Tom? Please don’t confuse or mislead others. Let them make their own choice.

    Lastly I think there are lot of mini tutorials hidden within the main tutorial, like the discussion regarding “blending with Overlay to increase white” etc. This is more of an experimentation rather just a collection of some steps to achieve a specific output. I really envy the way he is very casually discussing the whole thing. This is very heavy stuff but he is presenting it in a very light and casual way, Kudos.

  • http://damatajhiz.com/ Hamid

    Great article and technique…

  • http://rcdmk.com RCDMK

    A good collection of small tricks and techniques.

  • designerjain

    very nice tutorial thanks i think its backwards compatible with CS5 because only the clone stamp that would perhaps not work the same…

  • Daini Peagram

    The same effect can be done by copying the image to a new Channels layer.
    Create a new layer, fill it red.
    create another new layer
    Goto the menu: Select > Load Selection…
    load the selection from the new Channels layer
    Fill this selection white.
    Presto, same effect, less hassle.
    if you need the glass more pronounced, duplicate the glass layer again.

  • http://www.gurukulindia.net amit

    very nice tutorial thanks

  • MJ

    How do you select CMYK channels? Mine shows only RGB. Thanks in advance.

    • becky

      you need to change your colorspace to cmyk. (Image>Mode>CMYK)

  • MJ

    Just downloaded the ‘Glass of Water’ and what do I get? An image with your name on it – WTF!!!

  • Chris

    Very good exemple. But instead of using Apply Image in 4 step. You could have use Calculation instead in 2 step. Calculation does basicaly the same thing as Apply Image, but you can control everything in the same tool and output the result in a new channel or a selection, it’s quicker and you see the result right away. I call this tool, a Mask maker!

    It’s just my two cents

    • Jenn

      This is a great tutorial to learn a method, but I agree with you. I learned about Calculation in another tutorial and found that using that here would have been more efficient as well! Especially if you are on a deadline and want to get the same result, Calculation would probably be the way to go!

  • http://masterkingmahendra.com Mahendra

    Nice example for complex selection. I can use this in my photoshop class as lab exercise for my students.
    Thanks.

  • http://web-labor.pl Web-labor

    @MJ if your file is in RGB than you won’t see the CMYK channels. Alternatively go to Image > Mode to convert it to CMYK.

  • HAHA

    THANK YOU SO MUCH I’VE NEVER DONE THIS BEFORE
    I CAN APPLY THIS WAY TO OTHER PHOTO~
    I THINK IT’S SO USEFUL TUTORIAL

  • Armando

    What if the glass is photograph on a white background?

  • Armando

    *photographed