Welcome, Guest

Please login or register

TUTORIALS SUBMENU

PHOTOSHOP    FLASH    ILLUSTRATOR    BLENDER    CINEMA 4D    WEB-CODING

Related Links

Using Calculations & Channels To Create Masks


We all agree that masks are extremely useful and, in most circumstances, look a whole lot better than cutting the object out of it's background with the Lasso or Pen Tool. I'm sure we all, also, agree that they can take quite a long time to create, depending on the detail involved in the image. Wouldn't it be nice if there were an easier, quicker way to get, at least, the basic shape separated from the rest? Well, in some cases, there is! Be forewarned, however, that this method doesn't work for every image - Being based, primarily, on the Channels, (therefore, the colors of the image), the background and object need to be of contrasting colors. A brown-skinned person with brown hair on a brown background may not give as good results as, say, a red bird on a blue background, for example.

 
01

The Technique
I've chosen an image, (fig.01), with a great deal of color contrast. The parrot and branch stand out from the blue sky quite well. Switching to the Channels palette, we can see that, for this image, the Red Channel shows the upper half of the bird as being very bright while the rest of the image is made up of similar shades of gray. The Green and Blue Channels show a bit more contrast, especially the Blue one, which shows the sky as nearly white, (fig.02).

For those who don't know, each Channel represents the amount of that color in the image. The brighter a particular pixel, the more of that color the pixel contains. Black areas contain little or none of that color.

There is a neat little function, under the Image menu, that's been a part of Photoshop all along, but isn't used or even discussed very much, anymore. It's called Calculations. Opening the Calculations dialog, we see that we can choose any two channels and mix them using any of a variety of Blending modes. For this image, I chose to mix the Green and Blue Channels, using Linear Light as the Blending mode. I chose Linear Light because, in this instance, it gave the best results. Of course, each image will vary and you'll have to try them all to find the one that works for the image you're working on. On a side note, there are two new Blending options that are only available in Calculations. They are Add and Subtract and they do just what they say: add one channel to the other or subtract one channel from the other. You can, also, invert one channel or the other, (or both), to get different results.

Hitting "OK", in the Calculations dialog, will create a new Channel, named Alpha 1, (fig.03). We can see that this new channel is black&white, and high in contrast. A slight Levels adjustment, (under Image > Adjustments > Levels), bringing the black and white sliders in a little bit toward the center, (66, 1.0, 211) gets rid of the gray area in the sky above the bird. (fig.04).

The mask is, at this point, almost ready. It needs to be cleaned up a little bit, though, so we should use the Paintbrush to paint out the leaves in the background with white and the leftover details in the bird and branch with black, (fig.05). At this point, go to Image > Adjustments > Invert to reverse the black and white areas of the image, (fig.06), and you're done. Click on the RGB Channel, which will select and make visible the RGB (Red, Green, and Blue) Channels, then hold Control (or OPT if you are using a Mac) and click on the Alpha 1 Channel to form a "marching ants" selection around the bird and his branch. Now, switch to the Layers palette, copy the background layer, by clicking on it and dragging it to the Add New Layer icon at the bottom of the Layers palette (next to the Trashcan), then click the Add Layer Mask button, (second from the left, in the bottom of the Layers palette - looks like a box with a circle in it). You'll have to click the "eye" icon next to the original, non-masked layer to turn off it's visibility so that you can see what was done. (Masks don't work on locked background layers and copying it is quicker than unlocking it). Fig.07 shows the bird, masked out, on a simple white background and Fig.08 and Fig.09 show it on a couple of other backgrounds.

As I said, before, the image, itself, determines how well this method is going to work. With a little luck, you can use this method to mask out objects with a fair amount of intricate details, such as fur or hair.

02
03
04
05
06

 07  08  09

 

Extra Hints & Tips
Here's an extra tip for those times when you'd like to shrink or grow the mask while keeping it's shape: If you do a Gaussian Blur on the mask (just a few pixels, at most) then use Levels, you can make the edge of the mask smaller, i.e., tighter around the object, by moving the black slider to the right. Conversely, the white slider will make the edge of the mask larger. This is something that has to be played around with to find the best results and, therefore, should be done on a copy of that layer - so you don't lose all of your hard work if it doesn't work out.

Here's another tip. To deal with the "halo", or glowing edge around the object: Hold CTRL (or OPT) and click on the mask to get the "marching ants", then Select > Invert the selection. At this point, you have the hidden parts of the image selected. Now, click on the image thumbnail, itself, so that you're working with it and not the mask, and, under Select > Modify, click Expand and choose one or two pixels, (could be more for a higher resolution image). You'll notice that the "ants" are, now, within the visible part of the image. Next, go to Image > Adjustments > Hue/Saturation and click where it says "Master" and choose the color(s) that appear in the "halo". Simply reduce the Saturation and/or Lightness until it looks right to you. For an image like the bird, you'd want to adjust both Cyan and Blue but, as always, each image will vary. You could, also, try to Colorize it to match it's new background. By selecting the mask and modifying it first, your adjustments don't affect the whole image - just the edge of the visible area (as well as all of the hidden area - another good reason to have applied the mask to a copy of the original layer).

Well, that's all, for now. I hope this can be helpful to you in your future endeavours!

- Tutorial written by Zapphnath

Automatic Translations: Translate Into French Translate Into German Translate Into Italian Translate Into Spanish Translate Into Portuguese

Last 5 User Comments

User:  Guardian (#54999)
Date: Wed Dec 03, 2008. 01:40:10

Post #3 of 3

I have been shying away from this tool since, what? PS5 I think, and imagining it to be unattainable by anyone without an extensive study in logarithms or fractals or fuzzy math or things like that:einstein::) how wonderful to get a clear concise walkthrough and a fantastically simple, effective way to create a mask. I have a current project that will benefit greatly by use of this tool. Much appreciation, gratitude and my kudos to you Zapphnath. Thank you

Reply to this post


User:  S4C (#49833)
Date: Sat May 10, 2008. 23:19:23

Post #2 of 3

Thanks I finally understand how this calculations thing works!

Reply to this post


User:  fproehl (#24345)
Date: Wed Feb 22, 2006. 09:19:09

Post #1 of 3

Great stuff! Good technique for some images with good contrast. Saves a lot of manual work. Thanks for sharing!

Frank

Reply to this post


--- View Entire Thread ---
Featured Tutorialsmore

Simple Camouflage
Simple Camouflage
- Adobe Photoshop -
Inset Lines
Inset Lines
- Adobe Photoshop -
Hard-Edged Cel-Sha...
Hard-Edged Cel-Sha...
- Adobe Photoshop -
Basic Anime Eyes
Basic Anime Eyes
- Adobe Photoshop -
Membership

Username:
Password:  
Remember Me

Lost Password? || Register

Related Links

Special Options
Printer Friendly Version
Forum Threads

New Sheriff Wanted
Author: skates1
Posted: Mar 06th, 7:49pm
Activity: 0 replies, 79 views
Graphics and artwork remixing/collaborating web...
Author: artremaster
Posted: Mar 04th, 6:21am
Activity: 0 replies, 141 views
grafpedia(.com)
Author: tichnak
Posted: Mar 02nd, 10:54pm
Activity: 3 replies, 180 views
Hockey?
Author: stiney51
Posted: Mar 02nd, 2:39pm
Activity: 3 replies, 159 views
I am Back Guys!
Author: LaFleureRouge
Posted: Feb 27th, 6:09pm
Activity: 9 replies, 287 views
Banknote Design
Author: tichnak
Posted: Feb 27th, 4:50pm
Activity: 0 replies, 218 views
New Design & Font System!
Author: Man1c M0g
Posted: Feb 27th, 10:26am
Activity: 1 replies, 237 views
Domain Developers Fund
Author: tichnak
Posted: Feb 24th, 11:23pm
Activity: 7 replies, 324 views
WIP - AlexStanford.com
Author: ahstanford
Posted: Feb 24th, 2:37pm
Activity: 5 replies, 251 views
How do you make good repeating-image patterns?
Author: Mars
Posted: Feb 17th, 7:38pm
Activity: 1 replies, 398 views
Mech projects
Author: Culann
Posted: Feb 14th, 9:46pm
Activity: 5 replies, 426 views
I'm Back...
Author: ahstanford
Posted: Feb 14th, 2:01pm
Activity: 1 replies, 344 views
Forum Threads

--- Site Resources ---
Total Tutorials:212
Total Downloads:    417
Total Fonts:    4673