A First Look at Masks

[ LiB ]

A First Look at Masks

When the goal is to place a figure on a new background, or add a decorative edge to an image, or gradually fade one layer into another, masks are ideal. People new to image editing sometimes shy away from masks, thinking that masks are too complicated. Actually, however, masks are quite simple to understand and use.

What Is a Mask?

A mask is quite similar to an adjustment layer. It seems to affect lower layers in the layer stack. But whereas an adjustment layer affects color , brightness, and contrast, a mask affects opacity.

Think of a mask as a special layer that lets you paint with invisible paintthat is, paint that makes pixels on the layers below the mask layer appear to be invisible. A mask can also partially mask out some areas, as if the invisible paint were diluted, letting the paint of lower layers show through but at a lower opacity. Wash off the paint completely (that is, delete the mask), and the lower layer becomes entirely visible again.

A mask is a greyscale bitmap. In a color image, when you make a mask layer the active layer, the Available Colors panel in the Materials palette changes to show 256 shades of grey (including black and white). Black areas on the mask layer completely mask out paint on affected layers. In contrast, white areas on the mask allow all the paint on affected layers to show, and grey areas on the mask let the paint on affected layers show at reduced opacity. The darker the grey, the lower the opacity of the paint on the affected layers.

A mask seems to both keep new paint off a layer and strip existing paint from the layer. To see what this means, consider a layer with no transparent areas, as shown in Figure 4.44.

Figure 4.44. A single-layered image.

graphic/04fig45.gif


NOTE

graphic/p2.gif NOTE

Masks work only on true layers, so when you add a mask to a Background layer, Paint Shop Pro warns you that the Background is about to be automatically promoted to a layer.

Now, suppose that on the layer shown in Figure 4.44 you load a mask from one of the sample mask files included with Paint Shop Pro, Mask002.PspMask (see Figure 4.45). Mask002.PspMask can be found in Paint Shop Pro's Masks folder. (You can load a mask from disk by clicking the Load Mask From Disk button on the Layer palette toolbar.) The result of adding this mask to the image in Figure 4.44 is shown in Figure 4.46.

Figure 4.45. Mask002.PspMask sample mask from Paint Shop Pro.

graphic/04fig46.gif


Figure 4.46. The image with a mask added.

graphic/04fig47.gif


The mask is added as a new layer above the previously active layer, and those two layers are automatically put together in a layer group . As you see in Figure 4.46, the area covered by the dark part of the mask layer creates transparency on the data layer.

Now, return to the unmasked image of Figure 4.44. Suppose that a new, empty layer is added above the painted layer, and then a mask layer is added above the empty layer. If you then flood fill the empty layer below the mask layer with light-colored paint, the result looks something like Figure 4.47.

Figure 4.47. The flooded masked layer.

graphic/04fig48.gif


The white area of the mask allows that part of the layer to take on the new paint, whereas the black part of the mask seems to block the paint.

This probably isn't the effect that you normally want from an edge mask, though. Instead, you probably want the solid paint to show around the edge and the central part of the masked layer to be transparent (to let the content of the lower layer show through). You can easily create this effect by inverting the mask. Just make the mask layer the active layer by clicking its layer button and choose A djust > Ne g ative Image. The result is shown in Figure 4.48.

Figure 4.48. The same image with the mask inverted.

graphic/04fig49.gif


NOTE

graphic/p2.gif NOTE

A mask seems to strip paint away or keep new paint from being applied, but masking is actually a bit different from masking tape or acid. The whole layer really is affected, but you don't see the effect in the masked areas. So for the image in Figures 4.47 and 4.48, the whole top layer is filled with color, but what parts of that colored layer actually show up depends on what parts of the layer are currently masked and unmasked.

Creating and Editing Masks

You can create masks in a variety of ways. One method that you can use to produce quite interesting results is to create a mask from an image. To do so, open both the image that will serve as the basis of the mask and the image that you want to apply the mask to. Then choose L ayers > N e w Mask Layer > F rom Image to open the Add Mask From Image dialog box, shown in Figure 4.49.

Figure 4.49. The Add Mask From Image dialog box.

graphic/04fig50.gif


In the Source window drop-down selection list, select the image that you want to use as the basis of your mask. In the Create mask from section of the dialog box, you have three choices:

  • Source luminance. Creates a mask based on the luminance levels in the source image. Dark colors in the source produce transparency on the masked layerthe darker the color in the source, the less opaque the pixels on the masked layer become.

  • Any non-zero value. Black areas in the source image create complete transparency on the masked layer, leaving all other areas fully opaque.

  • Source opacity. Transparent areas in the source produce transparency on the masked layer, opaque areas maintain the opacity of the masked layer, and semitransparent areas produce partial masking.

The last control in the Add Mask From Image dialog box is the Invert mask data check box. When this box is checked, the mask is inverted. For example, when you have selected Source luminance and have checked the Invert mask data check box, lighter colors in the source produce more transparency than darker colors do.

Figure 4.50 shows a high-contrast image that has been added as a mask to the uppermost layer of a two-layered image, converting some of the areas of the upper light-colored layer to transparency, thereby allowing the dark color of the lower layer to show through. (The masked image is shown to the right of the image that was used as the basis for the mask.)

Figure 4.50. Example of a mask created from an image.

graphic/04fig51.gif


In this example, Source luminance is selected and Invert mask data is not checked.

You also can create a mask by hand. To do so, choose either L ayers > N e w Mask Layer > H ide All (to start with a mask that completely masks out the paint on the active layer) or L ayers > N e w Mask Layer > S how All (to start with a mask that lets all the paint on the active layer show through).

NOTE

graphic/p1.gif TIP

You can also click the Show All button on the Layer palette to create a new mask layer above the active layer. You won't see any difference on the image until you edit the mask. If you look on the Layer palette, though, you'll see the new mask layer grouped together with the previously active layer.

To edit the mask rather than the image itself, make sure that the mask layer is the active layer and then edit away. When you're editing a mask, it's sometimes helpful to show a representation of the mask. If you click the mask layer's Mask Overlay toggle in the Layers palette, the mask displays as a reddish, semitransparent gel covering the active layer. Those parts of the mask that completely mask out the layer's paint appear dark red, whereas those areas that let the paint show through don't show any red at all. Partially masked areas appear as various shades of red, with the degree of semitransparency over the underlying image varying with the level of masking.

Figure 4.51 shows an example of a mask being edited, with Mask Overlay on.

Figure 4.51. Editing a mask with Mask Overlay on.

graphic/04fig52.gif


You use black, white, and shades of grey to paint on a mask. Black creates total masking, whereas white allows all of the layer's paint to show through. Greys allow various levels of maskingthe darker the grey, the higher the degree of masking.

You can use just about any of Paint Shop Pro's tools and operations to edit a mask, including the painting tools, the selection tools, most effects, and the color adjustments that affect brightness and contrast.

That just about covers the basics of mask editing. Before you leave this section, though, be sure to try out the Group Link toggle for the header of the group that groups together a mask layer and the layer that is masked. A group header's Group Link toggle appears at the extreme right in the Layer palette. With the Group Link toggled on, if you use the Mover tool to move the mask layer, the layer that is masked moves along (and vice versa). Toggle the Group Link toggle off, and the mask layer and the layer that is masked move independently of each other. (That is, of course, unless these two layers are in the same link set.) Toggling the Group Link toggle on has the same effect as assigning the layers in the group to the same link set.

Deleting Masks

Masks are saved along with an image (as long as the file format used supports layers, as does the PSPimage format). You can also either permanently remove a mask or permanently merge a mask with the affected layer, however. In either case, you first delete the mask layer, using any of the normal methods for deleting a layer. You're then presented with a prompt that asks whether you want to merge the mask layer into the layer below it. If you just want to get rid of the mask, choose No. If you want to permanently merge the mask with the layer below it, choose Yes.

NOTE

graphic/p1.gif NOTE

You can also merge mask layers with other layers using the standard Merge operations for layers.

There are several reasons why you might choose to merge a mask with the layer it affects. One is that masks take up space in your image, in terms of both file size and the amount of resources required during editing sessions. So, for example, if you're low on disk space, you should merge masks where you can rather than save them with your images. Another reason for merging a mask is to remove paint permanently. A mask itself doesn't really remove paintit only makes it look like the paint is removed. If you want to remove paint entirely and permanently, merge your mask with the affected layer.

This is just the beginning of what you can do with masks. We'll explore masks in more detail in the next chapter.

[ LiB ]


Paint Shop Pro 8 Power
Paint Shop Pro 8 Power!
ISBN: B001QCXEI6
EAN: N/A
Year: 2006
Pages: 125
Authors: Lori J. Davis

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net