SitePoint Sponsor

Article

Home » Design and Layout » Software Tutorials » Fade Images in Photoshop Using Layer Masks

About the Author

Corrie Haffly

Corrie Haffly Corrie is the lead designer and developer for PixelMill and their in-house brand, jgtemplates. This would-be triathlete has a mathematics degree but wishes she had double-majored in computer science and art instead. Maybe next time...

Corrie Haffly has written 15 articles for SitePoint with an average reader rating of 9.

View all articles by Corrie Haffly...

Fade Images in Photoshop Using Layer Masks

By Corrie Haffly

June 3rd 2004

Reader Rating: 9.2

"I need an ad for the company home page advertising our spring sale," your supervisor says.

"Can you turn it around in the next hour?"

"The next hour?" you reply. "Just give me five minutes!"

The next thing you know, you're getting a raise in the time that it takes you to make a layer mask.

One of the best Photoshop tools to have in your arsenal is an understanding of how to use Layer Masks to "fade" pictures (a three-minute browsing session on your favorite Websites will show that lots of people use this effect). Not only does the effect look professional, it's quick to achieve. Within seconds, you'll have a sharp-looking image for your Website... and you might even impress a few supervisors while you're at it! Who would pass up an opportunity like that?

In this article, we'll show you two ways to use Layer Masks to fade pictures. As you learn how to use Layer Masks, you'll also pick up other skills in Photoshop:

  • Get images into a Photoshop document
  • Work with layers
  • Use the gradient, brush, and move tools
  • Resize images and layers

Eager to get started? Open Photoshop, find a few graphic files that you'd like to work with, and let's go!

The Basic Fade

First, let's look at creating a basic fade effect that will result in an image like this:

1348_layermaskexample1

Open your original photo in Photoshop.

1348_layermask01

Since this tulip photo was from my digital camera, it was a whopping 1920x2560 pixels. If your image is a lot bigger than the size of the final Web image that you want to create, click on "Image," then select "Image Size," and specify a new width and height for your image. I resized my image to a workable 300x400 pixels.

1348_layermask02

Starting Your New Document

To preserve the original photo, we'll create a new document. Go to "File", click on "New", and specify a new document with the dimensions that you want your final image to have (we created a new, 200x300 pixel document). Then, go back to the original image and type Ctrl-A. This will select everything in the image. Type Ctrl-C to copy, and then close the image without saving. In the brand new document, type Ctrl-V to paste your photo. You should now have a new 200x300 Photoshop document in which your original photo appears on its own layer.

If the photo is bigger than the new document, don't worry -- this is good! We'll discuss how to change the size later, but for now, we'll just focus on creating the fade effect.

Let's add a layer mask. With the Layers Palette open, click the "Mask" icon at the bottom of the palette.

1348_layermask04

This will add a layer mask, which you can see as a linked rectangle next to the picture.

1348_layermask05

Working With the Layer Mask

A layer mask is essentially a black and white "image." You can paint on the layer mask in white, black, and any shade of grey. White areas will allow the picture to show through; black areas will hide the picture. Shades of grey will affect the transparency -- also known as the opacity -- of the picture. For now, we'll create a simple black-to-white gradient on the layer mask. To do that, first select the Gradient Tool from the tool palette (you can hit the "g" key on the keyboard, as well, to toggle between the Gradient Tool and the Paint Bucket Tool).

1348_layermask06

Set your foreground color to black and your background color to white. You may click on the foreground and background boxes in the tool palette and choose the colors. Or, if your foreground is already white and your background is black, click the arrow icon to switch them.

1348_layermask06a

Make sure that the gradient toolbar previews a black-to-white gradient, as shown below (the black-to-transparent gradient will work as well).

1348_layermask07

Click once on the layer mask to make sure that you're "on" it, so that you don't accidentally paint your picture black! Then, click at the bottom of the picture, hold the mouse, and drag the mouse straight up. You can hold the shift key while you drag to "force" the cursor to move in a straight line. Move the cursor up to about where you want the fade to "end," and let go.

1348_layermask08

And there you have it -- your first beautiful fade using a layer mask!

1348_layermask09

Manipulating Layers

1348_layermask09

Now, as I look at the picture, I decide that I don't like the way the fade "hides" part of that tulip. In fact, I want to somehow move the whole picture "up," but leave the gradient the same. The beautiful thing about layer masks is that this is possible!

A quick word about the wrong way to achieve this effect: It would have been just as easy (and saved a few steps) to set the gradient tool to a white-to-transparent gradient, then add a white gradient to the bottom of the picture layer. The problem with this approach is that the white gradient becomes a permanent part of your picture. You can't move the picture or the gradient around and, if you decide you don't like the gradient several steps down the road, you can't get rid of it without losing any other changes that you've made. All of this should convince you that layer masks are awesome!

Back to the how-to: in the Layers palette, you'll see a little "link" icon that connects the picture to the layer mask. Click the link icon to "unlink" the picture and layer mask.

1348_layermask10

Click once on the picture in the Layers Palette so that you can be sure you're working with the picture itself, not the layer mask. Then, choose the Move tool (or simply use the keyboard shortcut and type "v").

1348_layermask11

Click somewhere within the document, hold the mouse button down, and drag your mouse to move the layer around. I moved the tulip up to fill most of the picture.

Note that this step can only really happen if your picture is actually larger than the canvas size. Recall that the pasted-in picture was 300x400 pixels wide, while our actual document canvas size is 200x300 pixels.

1348_layermask12

Finally, add the text, select "save the picture for Web," and email it to your supervisor.

1348_layermask12a

Here's an extra tip. What if you want the image to blend into a site that has a different background color? The answer is simple -- use the paint bucket to fill in the Background layer with your desired color. Another beautiful aspect of layer masks is that they change the actual transparency of parts of the image, so you can overlay the picture on any background! The picture below shows the colored Background layer, and our perfectly fading tulip and ad copy.

1348_layermask12b

Brush Your Way To a Layer Mask

"I love it!" exclaims your supervisor. But, five minutes later, he's back with a glum face. "The marketing department wants something with a person in it," he says. "A happy person."

"Not a problem," you respond. "I have just the photo -- and the layer mask know-how!"

In this second project, you'll learn how to use the airbrush tool on a layer mask for delectable results. The end-product will look something like this:

1348_layermaskexample2

We start with a picture of an excited shopper on its own layer, with a layer mask already applied. I want to hide the faint lettering above her hands, and fade out the right side to make way for my great advertising copy. Because the shape of the woman and shopping bags doesn't match well with a straight gradient, I decide to use the brush tool for a more organic fading effect.

1348_layermask13

To start, select the brush tool from the tool palette. You may use the keyboard shortcut "b" to toggle between the brush and pencil tools.

1348_layermask14

In the Brush toolbar, click on the brush type dropdown and choose a suitable soft-edged brush. I chose the 100-pixel diameter brush.

1348_layermask15

Then, start painting the edges of the picture's layer mask -- with a black foreground, of course -- to "hide" part of the picture.

1348_layermask16

Manipulating the Picture

As I look at the result, I decide that the picture of the excited shopper is a little too big, as the final picture needs to have a bar of text across the top. To shrink the picture without shrinking the layer mask, first unlink the picture and layer mask by clicking on the link icon in the Layers Palette.

1348_layermask17

Click once on the picture in the Layers Palette to select it. Then, select the Move tool from the Tool Palette. Type Ctrl-T to "Transform" the image. Click on the corner of the picture, hold, and drag the corner down to resize the image. Hold the shift key while dragging to "constrain" the picture so that it resizes proportionately -- the last thing you want is a squished shopper!

After you get the picture to the desired size, double-click inside the rectangle to apply the change.

1348_layermask18

The picture is now the right size, but I decide that I also want to "fade out" the shopping bags slightly so that the woman really stands out. I don't want to hide the bags completely, so I choose a dark grey color (#4D4D4D) instead of black to paint on the layer mask. With the brush tool, I paint over the shopping bags on the layer mask, and also decide to let a little bit of the background show through. In the picture below, you can see the different shades of black, grey, and white on the layer mask.

1348_layermask20

I touch up the edges of the layer mask with black paint and add my ad copy using the text tool. And, there's the ad! I only hope the marketing department will be happy…

1348_layermask21

Ready, Set, Mask!

Congratulations! You now know how to use the gradient tool and the brush tool on layer masks to create fantastic Web graphics. And you're only at the beginning of a huge range of possibilities. Here are a few suggestions as to how you might further apply your layer-masking power:

  • Create a collage of almost seamless pictures.
  • Photoshop a picture of yourself into a beautiful landscape … or any object onto your desired background!
  • Hide unsightly background objects from photos.

Print-Friendly Version Suggest an Article Link to this Article

Follow SitePoint on...