Advanced Selections, Masks and Compositing.

Part 2: Using masks made from layers, selections,
gradients with blend range settings
to form composited image.

Paint Shop Pro Tutorial for June 27, 2002

[ PSP index ] [ Composite Index ] [ PSP Links ] [ 3D Bits n Pieces ] [ Tutorial CD ]

1. Understanding Masks:

What is a Mask?

From the PSP Help Files:

"A mask is a greyscale image applied to a layer. Masks are used to hide and display parts of the layer, to fade between layers, and to create special effects with precision. Masks can be created from selections, alpha channels, and images.

A mask can cover a layer completely or with varying levels of opacity. The grey value of the mask determines how much it covers. Where it is black, it completely masks the layer, producing a transparent area; where it is white, it leaves the layer unmasked (in its original state); where it is grey, it produces a semi-masking effect, with the transparency increasing as the grey becomes darker.

All masks are created and edited in a raster, greyscale mode. Therefore, all tools and image processing features that work on greyscale images work on masks.

The tools that can be used in either vector or raster mode (Drawing, Preset Shapes, and Text) work only in their raster modes when editing masks.

A mask works the same way with a vector layer as it does with a raster layer. It can be linked to a layer, which moves it with the layer.

If a mask is not linked to the layer, moving the layer’s content will not affect the position of the mask.

Because a mask is greyscale, it can be saved with the image, in an alpha channel or as a separate image on a hard disk.

Also, a selection can be loaded as a mask and a mask as a selection from an alpha channel."

To create a mask on an image, the image must be a 24 bit image. If it is less, go to Colors on the Menu Bar and pick Increase Color Depth, choosing 24 bit from the fly out box.

Let's put Masks to use in our Compositing project.

Open Dennysbooth.jpg by clicking on the image on the left to open the bigger version.

Right click on that image choosing Save As from the fly out box, use the name Dennysbooth.jpg and save to your hard drive.

As above, click on the image on the left and save bigger version to your hard drive as Narcissus.jpg.

Open Narcissusjj.jpg and Dennysbooth.jpg in Paint Shop Pro 7.

Let's assume we want to make an artsy composition from these two images by highlighting part of the narcissus on the Denny's booth.

Here is how we can go about it. The Dennysbooth will become the main image.

Right click on the title bar of the narcissus picking Copy from the fly out box. Select the Dennysbooth by clicking on its title bar, then Right click choosing Paste as a new layer.

Close the original Narcissus.jpg as we don't need it anymore.

On the main image, on the Layer palette, "L" key on your keyboard, right click Layer one on the layer palette picking Rename from the fly out box. Type in Narcissus.

2. Mask from Layer using Source Luminance

Let's make a mask using the narcissus layer. Go to the Menu Bar, click on Masks, then New, then From Image on the fly out box

On the Add Mask box, choose This Window from source window area.

In Create Mask From... use Source Luminance. Press OK.

Notice that only the lightest parts of the flowers show up whilst the dark background in the Narcissus disappears.

Source luminance takes the luminance value of the pixel color to determine the degree of masking.

Remember that Mask means to hide. Lighter values produce less masking. (Remember our Histogram lessons?)

On the layer palette the mask face icon shows up next to the layer's name. This indicates a mask is associated with the layer.
Also see the Mask tab with the mask indicated in the right hand panel.

Masking a layer is non destructive, meaning the underlying layer is not altered, just its visibility in the image.

Click the Mask tab on the right panel. See the two icons.

Again note the mask face and the Link Icon. Click the mask face to turn OFF the mask.


When it has a red X through it, the whole layer is visible in the main image.

The linking Icon, when enabled (default), keeps the mask and the layer moving together.

Clicking the link icon disables the "togetherness" and the mask and layer can be moved separately.

One usually keeps the link enabled.

Reset the Link and Mask icons to enabled, that is without the red Xs.

Use undo if you tried moving around unlinked.

3. Viewing Masks

Masks can be "viewed" by going to Masks on the Menu Bar > View.

The deeper the red Masking indicator color, the more the underlying image is masked.

Notice how the white flowers are very clear and redless and how the mask gradates to a deep red in the darker spots.

Notice how the whitest flowers are very clear and redless and how the mask gradates to a deep red in the darker spots.

It is helpful to "view" the mask this way when you are working on it.

4. Editing Masks

On the Menu bar click Masks > Edit.

Although you won't see a change in the image itself, you will see the color palette change to 256 shades of grey.

This is an indication that you are in the EDIT mask mode.

In the Mask Edit mode, you will ONLY make changes to the mask on the layer, NOT to the image layer itself!

Be sure you ARE in the MASK EDIT mode or you will make changes to the actual layer!

Both the View mask and Edit Mask functions are toggles, meaning you click them on and click them off. Learning the keyboard shortcuts for these are handy. CTRL + K for Edit Mask and CTRL + ALT +V for View mask.

Turn on the view mask so you see red, and enter the Mask edit mode. Pick the Paint Brush tool from the Tools Palette.

Choose White from the color palette.

With the brush set to round, size of 45, hardness 0 and Opacity of 100 on the Tool Options Palette, paint in the image over the center narcissus.
>>>> Notice how more of the narcissus layer becomes visible though the red.
For grins, turn off the view mask (CTRL + ALT + V) and see what changes have been made to the image.
Turn the View Mask back on, (CTRL + ALT + V) Work with the brush and expose a good amount of the narcissus layer.
On the Layer palette, right panel, Masks tab. Click the Mask face icon, turning it off. Notice in the image that nothing has been altered on the layer itself. :)

Back in the image, with the View mask on, pick the brush and choose black from the color palette.

Paint over the same area as before. Notice how the underlying layer from the Denny's booth becomes more visible.

Using white and varying the brush size, and hardness, use the paint brush to pop out the white narcissus blooms.

Then make black the foreground color. Make the brush a bit smaller, say 30. Paint in the image to bring out the leaves on the underlying layers.

If the edges are kind of rough, or you painted too far, switch back to white and make smaller brush and make the opacity about 20 percent then paint the mask off.

Use black to paint the mask back onto the layer if you accidentally revealed too much of the underlying layer.

Turn off the view mask to see what you have actually done.

This is the essence of using a mask.

5. Masks from Selections:

All a mask is is a fancy selection. Let's add another element to this image. Let's make a Mask from a Selection.

Turn off both View Mask and Edit Mask from the Menu Bar > Masks...

Right click on the image on the left and save to your hard drive as Cyclamen.jpg

Open Cyclamen. jpg in Paint Shop Pro.

Copy the cyclamen image by right clicking on its title bar and picking copy.

Switch to the Dennysbooth image, right click on its title bar choosing Paste as a new layer from the fly out box.

Rename the layer Cyclamen on the Layer Palette.

Note it is smaller than the working image and comes in centered in the middle of image.

Let's use the magic wand from the Tool Palette to isolate the sharpest flower in the photo.

Set the Tool Options to Hue as the match mode, Tolerance of 60 and Feather to 0.

Click in the flower in the brightest pink on the foremost petal.

Most of the flower is selected.

Lower the Tolerance on the Tools Options Palette to about 26 and Shift click in the pink unselected area to add it to the selection.

Go to Selections > Modify > Contract from the Menu Bar. Do 2 pixels.

Then Selections > Modify > Feather 2 pixels to soften the edges of the selection.

Turn the selection into to a mask so only the flower shows above the layers below.

On the Menu bar, go to Masks > New > Show selection.

Presto, our selection becomes a mask.

Remove the selection. Selections > None from the Menu bar.

Note, on the layer palette, there is mask icon next to the Cyclamen layer.

If you turn off the Mask icon on the right hand panel in the Masks tab, the whole layer is again visible.

To see the mask, go Masks > View mask on the Menu bar and note the red indicator areas.

Undo the View using either the Menu toggle or the Keyboard short cut, CTRL + ALT + V

On the layer palette, right click the cyclamen layer and duplicate. Repeat the duplicate for 3 separate cyclamens.

Note the mask is duplicated as well.

Move each cyclamen with the 4 headed mover tool around the middle of the image.

(You will see where we are headed with this in a bit.)


Resize any layer BEFORE putting on a mask as resizing the layer after a mask in on results only in the layer being resized NOT the mask.

6. Gradient Fill

Going crazy with this, add another raster layer by right clicking the top layer on the layer palette and picking New Raster layer from the fly out box.

Name this layer Gradient.


In the image, engage the Flood Fill tool. Set the foreground color style to gradient by clicking on the right facing arrow next to the swatch on the color palette, picking the second icon, the gradient from the fly out box.

Click on the foreground color swatch itself to bring up the Gradient Editor.

Click the down facing arrow next the the preview box and select the Black-White Gradient on the thumbnail area.

Set the angle to 0, the style to Linear, the top one and the repeats to 25.

On the Tool Options Palette, set the blend mode to normal, the match mode to RGB value the tolerance to whatever and opacity to 100.
Click in the image to fill the gradient layer with the gradient.

Well that's ugly!

We want the underlying layers to partially show through, making it look as though we are peering into the scene through mini blinds.

7. All About Blend Ranges...

Right click on the Gradient layer on the layer palette, picking properties from the fly out box. Click the Blend Ranges Tab.

From the PSP Help Files:

"When you select a blend mode from the Layer Properties dialog box or Layer palette, Paint Shop Pro applies the blend to all the pixels in the layers. To limit the effect of the blend to pixels with specific values, use the Blend Ranges tab of the Layer Properties dialog box.

By setting opacity based on brightness or channel value, you can drop colors from the current layer and make other colors show through.

Set the opacity ramp for the channel. The upper arrows indicate the values at which the opacity will be 100%. The lower arrows indicate the values at which the opacity will be 0%. The values on the left side indicate the ramp up values, while the values on the right side indicate the ramp down values."

Using the Grey Channel, since we have no color here for the blend channel, move the upper left hand arrow in the This layer: box to the right until it reads 185.
Notice in the image the black is dropped out leaving leaving a fuzzy semi transparent edge.
Back on the Blend Range Panel, move the bottom left slider up to 175 in the This layer: area.
Note how the fuzzy blend edge drops out and becomes clearer.

If you set the bottom slider directly under the top one, the edge is very hard. The farther apart in distance the sliders are, the fuzzier the edge.

Press OK to set the Layer.

Note on the Layer palette, a new icon shows next to the layer palette indicating Blend Ranges are in effect for this layer.

You can rework the Blend Ranges any time by right clicking the layer name and picking properties.

Tint the blinds slightly blue by going to Colors > Colorize from the menu bar. On the dialog box set the hue to 162 and the Saturation to 114. Notice the preview shows the Unblended layer.








Press OK.

8. Selection to Mask again:

BUT... We really want the flowers unobscured by the bars...

Lets use a selection -to -mask to make this happen.

With the gradient layer still selected, Pick the rectangular selection tool from the tool box. On the Tools Options palette, set the selection type to Ellipse and feather to about 30. Check Anti alias.

In the image drag a selection that encompasses most of the pink flowers. See Below.

When you release the mouse button the feather is added to the outside.

Go to Masks on the Menu bar, New, Hide Selection.

Note how the bars drop out inside the selection and fades gradually back to full opacity.

Leave the selection on the image.

Add a new raster layer, naming it Curtains on the layer palette. (Right click on the top layer on the Layer Palette etc.)

Pull this layer below the Gradient layer.

Engage the Free hand selection tool from the Tool Palette. On the Tool Options Palette, set to Point to Point with the Feather at 15 and Anti alias checked.

Click a curtain like diamond shape around the flowers.

The selection will enlarge to accommodate the feathering after the mouse button is released.

Invert the selection. Selections > Invert from the Menu Bar.

Pick the Flood Fill tool. Set the foreground color swatch to Pattern Fill. Then click on the swatch itself.

Find the pattern "Flowers" from the thumbnails under the down facing arrow next to the preview swatch.

Set the scale to about 74 percent. Angle to 0.

On the Tool Options Palette, set the Blend mode to Normal, Match to RGB, Tolerance to whatever, and Opacity to 100 percent.

Click in the image in the selection to fill with the curtain pattern.

Yikes. It's horrible! (They don't call me Nonartist for nothing!)

Go to Colors > Colorize from the Menu bar.

Set the Hue to 220 and the Saturation to 100.

Press OK to turn the curtains reddish violet. This matches the image much better!

OK! I guess we better stop here before totally trashing the image.. LOL

Take the crop tool, Crop it down some.


Add your name with Vector Text, and SAVE in the psp format.

Merge the Layers and export as a JPG.

I cain't train you to be an artist: I can only show you how to use the tools. :D

End of session.

See you all next Fall!

[ PSP index ] [ Composite Index ] [ PSP Links ] [ 3D Bits n Pieces ] [ Tutorial CD ]

All Tutorials and Tips including images and text
Copyright 2003 3D Workshop, Inc.

Further distribution prohibited without express permission.
For information e-mail is in image below