When you select part of an image, the area that is not selected is masked, or protected from editing. When you create a mask, you isolate areas of an image as you apply color changes, filters, or other effects to the rest of the image. You can also use masks for complex image editing such as gradually applying color or filter effects to an image.
You can add a mask to a layer and use the mask to hide portions of the layer and reveal the layers below. By default, the layer mask is linked to the layer that it is attached to.
To save a selection more permanently, you can store it as an alpha channel. The alpha channel stores the selection as an editable grayscale mask in the Channels panel. Once stored as an alpha channel, you can reload the selection at any time or even load it into another image. Masks are stored in alpha channels. Masks and channels are grayscale images, so you can edit them like any other image with painting tools, editing tools, and filters. Areas painted black on a mask are protected, and areas painted white are editable.
If you want to directly edit layer transparency, create a mask for this data.
You can Shift-click the thumbnail to disable it and make the image and its channels opaque.
Photoshop converts transparency into an opaque color, hidden by the newly created mask. The opaque color varies greatly, depending upon the filters and other processing previously applied to the layer.
Channels are grayscale images that store different types of information:
An image can have up to 56 channels. All new channels have the same dimensions and number of pixels as the original image. With an RGB image, which has three color channels (red, green, and blue), and a composite (RGB) channel, you can add up to 20 additional alpha channels.
The file size required for a channel depends on the pixel information in the channel. Certain file formats, including TIFF and Photoshop formats, compress channel information and can save space. The size of an uncompressed file, including alpha channels and layers, appears as the rightmost value in the status bar at the bottom of the window when you choose Document Sizes from the pop‑up menu.
Note: As long as you save a file in a format supporting the image’s color mode, the color channels are preserved. Alpha channels are preserved only when you save a file in Photoshop, PDF, TIFF, PSB, or raw formats. DCS 2.0 format preserves only spot channels. Saving in other formats can discard channel information.
PNG does not support arbitrary alpha channels like other formats such as TIFF. PNG specifies that the fourth channel in a file is transparency, and only transparency. When you open a PNG file with transparency in Photoshop, it is considered a single layer image. It is not a flat background image. Alpha channels can contain anything, while transparency is a specific channel relationship. You can have multiple alpha channels per document, but only one transparency channel. Photoshop handles transparency and alpha channels separately. Transparency from an existing PNG can be edited in Photoshop by creating a layer mask from the transparency data (see steps below).
If you want to see the opacity of a given point in an image file, follow these steps:
Masks are stored in alpha channels. In the channels panel, you should see a Layer 0 Mask. Hide the color channels and make the Layer 0 Mask visible by clicking the eye icon to see the mask. Masks and channels are grayscale images, so you can edit them like any other image with painting tools, editing tools, and filters. Areas painted black on a mask are protected, and areas painted white are editable.
If you save the file as a PNG, and then reopen the PNG in Photoshop, the transparency is implicit. You don't see a layer mask thumbnail or a mask stored in an alpha channel.
You can select all the non-transparent areas on a layer, or, if a layer mask exists, all the unmasked areas. Selecting these areas is useful when you want to select image content that is surrounded with or contains transparent areas, or to create a selection that excludes masked areas on a layer.
1. Do one of the following:
You can select the channel from the Channels panel to see the saved selection displayed in grayscale.
If you double-click the channel, it brings up the channel options dialog window. The dialog window indicates if the color indicates "masked areas," "selected areas," or "spot color."
If an image contains a clipping path, the clipping path is displayed in the Photoshop “Paths” window with its name displayed in bold font.
If an image contains an alpha or mask channel, the extra channel is displayed in the “Channels” window. Every channel in the “Channels” window has an icon of the current image. If you double-click this icon, nothing happens for process colors, but a “Channel Options” window is opened for masked, alpha, and spot channels. This “Channel Options” window displays properties of extra channels.
If an image contains a transparency channel, it is NOT displayed in the “Channels” window. Instead, the “Layers” window contains exactly one layer entry (displayed in non-italic font) and no background layer entry.
If an image contains multiple layers, the “Layers” window contains more than one layer entry.
There are several different techniques to create transparency in raster images:
The most common way of creating transparency in prepress production uses clipping paths. Clipping paths isolate foreground objects and make their background transparent. Clipping paths are vector-based line structures which create hard edges between foreground objects and transparent background.
Alpha and mask channels
Some image formats support alpha or mask channels.
In all raster images each pixel is represented by a set of numerical values for all colorants of the image, depending on its color space. If an image contains an alpha channel, each image pixel is represented additionally by a numerical value which specifies the opacity of that pixel. In alpha channels, 100% specifies an opaque pixel and 0% specifies a transparent pixel. Mask channels are exactly like alpha channels except for their polarity. In mask channels, 100% specifies a transparent pixel and 0% specifies an opaque pixel. Alpha and mask channels offer multilevel transparency for drop shadows and soft edges of objects, also known as feather effects. If an image format supports alpha and mask channels, any image of that format may contain zero, one or multiple alpha or mask channels. The extra channels can be identified by their unique names. If an image contains one or more alpha or mask channels, the user has the option to apply none of the extra channels or exactly one of them.
Transparency channels are much like alpha channels. Raster image formats supporting transparency channels can contain exactly one or no transparency channel. The user usually does not have the choice whether to apply the transparency channel or not. The application of a transparency channel is mandatory. Each image pixel is represented by a set of numerical values for the visible colorants and one additional numerical value containing the opacity information. 100% specifies an opaque pixel and 0% specifies a transparent pixel. Transparency channels offer multilevel transparency, too. A well-known example of an image format with transparency channels is PNG with RGBA color.
The most complex way of creating transparency currently is to combine multiple layers in Adobe Photoshop. Only TIFF and Photoshop native documents support multiple layers. TIFF images always contain a main image which is a combination of all Photoshop layers. But Photoshop native images contain a main image which is not necessarily a combination of all Photoshop layers.
A layer mask is a transparency mask that is attached to the layer. It only appears in the alpha channel if the layer is active.
unassociated alpha channel
RGB images with alpha transparency can be stored in two different ways. One way is to store raw RGB values and alpha values as separate and independent channels; this is called "unassociated alpha". PNG standardized on "unassociated" ("non-premultiplied") alpha so that images with separate transparency masks can be stored losslessly. Most image-processing programs stores images with unassociated alpha, to be able to manipulate RGB and alpha independently of one another, and not lose RGB data when zeroing out alpha.
pre-multiplied alpha channel
Another way is to store RGB values not raw, but premultiplied by corresponding alpha value, which is then called "associated alpha".
If an alpha channel is used in an image, it is common to also multiply the color by the alpha value. This is usually referred to as premultiplied alpha. "Premultiplied alpha", stores pixel values premultiplied by the alpha fraction. The alpha information of a pixel is not only stored in the alpha channel itself, but it is already "multiplied" into the red, green, and blue channel. Rendering software prefers associated alpha, because with RGB values already multiplied by alpha, less work remains to be done in real time when doing alpha blending. TIFF support both types of alpha, but are frequently mislabeled.