| 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 |
|
|
|
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
| 
|
|
|
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 ---
|

|
|
 |
php, shoutbox problems Author: vanhansen Posted: Nov 17th, 1:30am Activity: 5 replies, 91 views
|  | MarkupGeeks Logo Author: ahstanford Posted: Nov 16th, 8:45pm Activity: 11 replies, 148 views
|  | Drawing Tutorials Author: ahstanford Posted: Nov 16th, 12:46am Activity: 0 replies, 98 views
|  | Superbowl predictions, anyone? Author: ahstanford Posted: Nov 15th, 10:46pm Activity: 10 replies, 137 views
|  | Photomanipulation Footsteps Author: ahstanford Posted: Nov 15th, 10:43pm Activity: 4 replies, 94 views
|  | Learning to draw... Author: ahstanford Posted: Nov 15th, 12:43pm Activity: 4 replies, 115 views
|  | Looking for simple UI elements Author: FenixRoA Posted: Nov 15th, 6:40am Activity: 7 replies, 108 views
|  | HDD Help? Author: Phoenix Wynde Posted: Nov 13th, 2:31am Activity: 1 replies, 106 views
|  | Fun New Battles Posted! Author: ahstanford Posted: Nov 11th, 7:33pm Activity: 0 replies, 139 views
|  | 4-man Simon Tournament Author: ahstanford Posted: Nov 11th, 3:28pm Activity: 0 replies, 90 views
|  | Design Brief Inspiration for BioRUST Battles! Author: ahstanford Posted: Nov 11th, 7:19am Activity: 4 replies, 139 views
|  | The BioRUST Free Stock Photography Thread Author: ahstanford Posted: Nov 11th, 6:32am Activity: 2 replies, 146 views
|  |
|
 |
 |
 |
 |
 |
| --- Site Resources --- |
| Total Tutorials: | 212 |
| Total Downloads: | 415 |
| Linkbase Links: | |
 |
|
 |
 |
|