Mask in Photoshop

Mask in Photoshop is used to hide some part of an image on the layer. We can apply mask on a layer. The part which is under mask will be hidden and rest of the part will be visible.


There are three types of Mask that we use in Photoshop:

(1)  Layer mask

(2)  Vector mask

(3)  Clipping mask

Let’s see each masking technique one by one:


(1) Layer mask

Let’s open below image in Photoshop.

Layer mask in Photoshop.PNG

We have background layer as White. See below:

Layer with white background.PNG

Now drag Toys layer to the mask icon , which is at the bottom of Layers panel.

Mask icon at the bottom of Layer panel.PNG

Release the mouse button after dragging the Toys Layer over mask icon at the bottom. See below.

Release mouse over mask icon.PNG

We can see that a white thumbnail has been created, adjacent to the Toys layer icon. This white thumbnail is a Mask.

White thumbnail mask.PNG

Before we proceed further on this example, let’s first understand the meaning of white mask.



What is white mask?

As we can see in above pic that the mask created is White thumbnail mask or white mask.

White mask does not hide anything and we can see through it. In other words, it is a transparent mask.

If someone puts a white mask on his face, then his face will be visible. Same thing happens with an image. If we put white mask on an image, then the image will be completely visible to us.

White mask example:

In below pic, we can see the effect of applying a white mask on an image. We can see through the white mask; hence it reveals the image over which it is applied.

White mask example.PNG

What is Black mask?

Black mask is just reverse of white mask. It is used to hide something. If someone wears a black mask on his face, then his face will be hidden. Same concept applies on the image with black mask.

An image with black mask would be hidden from us. Since the image layer with black mask will be completely hidden, we can see what lies underneath this image layer.

Black mask example:

In below pic, Toy Image with Black mask will be completely hidden and hence will reveal the underneath layer, which is a Red color background.

Black mask example.PNG

How to get Black mask?

Click on the mask thumbnail on the layer and then press “Ctrl+I” (Inverse). It will turn white into black.

Black mask.PNG

Below is what happens when we get a black mask on Toys layer. It will become hidden and will reveal the layer underneath it, i.e. white background layer. See the output below:

Black mask on Layer.PNG

Black mask + White mask

Let’s reverse the mask from Black to white again. For this press “Ctrl+I” on the Black mask icon. To get black mask along with white mask, we will use paint brush tool and paint the canvas with black color, while the mask icon is selected.


Hence, below are the steps:

(a) Set the foreground color as black .

(b) Select paint brush tool .

(c) Click on the mask thumbnail on the image layer . When we click on the mask, then the mask thumbnail will be surrounded by bracket like borders . It means, currently mask on the Layer is selected.

(d) After selecting the mask, paint on the canvas with black color.

(e) When we paint with Black color on any part of the image then that part of image will be hidden on the canvas. Since that part is hidden, it will reveal what is on underneath layer.

(f) Same way, when we paint with White color on any part of the image then that part will become visible.

In below image, when we paint with black color while the mask is selected, we see the middle toy becomes hidden and it reveals what is on the underneath layer (white background).

Paint mask with black color.PNG

After painting the middle toy completely with black color, the mask thumbnail appears as .

White plus Black Mask.PNG

Output - White + Black Mask

Output of White plus Black Mask.PNG

Why do we use Mask in Photoshop?

In above example, we saw how to hide middle toy using Mask in Photoshop.

We can get the same result if we use eraser tool and erase the middle toy. But the problem with eraser tool is that it deletes the pixels of image permanently. Once deleted, we cannot recover those deleted pixels. Suppose while erasing, we remove some pixels of the image that shouldn't be removed then it will quite tuff task and sometimes impossible to recover the deleted pixels. Hence, we use masking technique.

In this technique, we do not modify the original image. Rather we put a mask on the original image and modify the mask to hide or reveal any part of the original image. To hide we paint the mask with black color and to reveal, we paint the mask with white color. Hence, without touching the original image, we can get the required image just by modifying the mask.



Mask Operations:

We can do many mask operations which include Inverse a Mask, Delete a Mask, Disable a Mask, Refine a Mask. Let's see each one by one.

(1) Inverse a mask

As discussed earlier, we can press Ctrl+I to inverse the mask. Below is the output when we Inverse the above mask.

To inverse, select the mask thumbnail and press Ctrl+I.


Inverse mask output:

Inverse mask output.PNG

(2) Recover hidden part of the image.

To recover part of the hidden image, use white paint brush. For this set the Foreground color as white .

Then select the mask thumbnail and start painting on the canvas that you want to recover.

Below is how we recover the part of the image:

Paint with white on mask.PNG

(3) Disable or delete the mask in the Layer.

To disable or delete the mask, right click on the mask and select Disable Mask or Delete Mask. Disable is used to block the mask without removing it. Delete will remove the mask completely. See below:

Disable the Layer mask.PNG

After we disable the mask, mask layer will be as . We get below image after disabling the mask:


Disable layer mask output:

Disable Layer mask output.PNG

(4) Refine Mask Technique

Open below image in Photoshop. Say the layer name is Toy layer. We have white as a background Layer.

Refine mask technique.PNG

Now create a mask on the Toys layer. Then paint the mask with black color in such a way that only middle toy is left on the canvas. See below:

Create a mask.PNG

Below is how the mask layer looks like

Created mask icon.PNG

As we can see that the outline of the middle toy is not perfect and we still need to remove some unwanted pixel to get a perfect middle toy pic. To make the outline perfect, we have a concept known as “Refine mask”.

We can use Refine mask to get more accurate picture selection around the edges. As we can see that the picture has some unwanted pixels around the edge of the toy.

Right click on the Mask and select Refine Mask to open a window.

Refine mask now.PNG

In Refine mask window, we have different view mode. We can change the view mode as per our need. It is just how we want to view the masking on the image while editing. In below view mode, the edges are nicely visible and hence can help us to see the effect of editing quite nicely.

Refine mask window.PNG

Refine Mask view modes:

Refine mask view modes.PNG

Check the smart radius and set the radius to 6.5. Smart radius controls the transparency of pixels around the edges. Larg radius means more gradual transition of transparency around the edge. After setting radius to 6.5, many unwanted pixels around the edges are gone. See below:

Smart radius on Refine mask.PNG

Now set smoothness, feather & contrast under Adjust edge parameter. With below settings, we get rid of unwanted pixels around the edge completely. See below:

Set feather in Refine mask.PNG

Press OK to accept the changes. Below is how the picture looks like after above refine mask. We have got desired finishing at the outline of the toy.


Refine mask output:

Refine mask output in Photoshop.PNG

(2) Vector mask

Vector mask in Photoshop is a kind of mask, which is created with the help of pen tool or shape tool. This type of mask will be resolution independent.

Let' use Pen tool to make a Selection of the middle toy. See previous chapter, if you are not aware of Pen tool.

Vector mask in Photoshop.PNG

After making the Selection with Pen Tool, go to Work Path. We can see a path is created for the Selection, we made.

Work path.PNG

Now go to Layer menu and select Vector Mask and then select current path. It creates a Mask from the Selection, we made. The Mask is Vector mask.

Vector mask to current path.PNG

Below is how the image appears after the Vector mask is created for the Layer.

Create vector mask.PNG

We can edit the vector mask using Direct selection Tool. This is the benefit we get in Vector mask technique. Use Direction Selection Tool and click on the image. It will appear with anchor points which we can move here and there to refine the edge.

Direct selection tool on Vector mask.PNG

After adjustment with Pen Tool we get below output.

Output after adjustment with Pen tool.PNG

We need to Refine mask to get a perfect edge. For this, we must rasterize the mask. Right click on the Mask thumbnail and select Rasterize Vector Mask.

Rasterize vector mask.PNG

In Refine mask, do the settings as shown below:

Refine mask settings.PNG

Vector mask output

Vector mask output after Refine mask.PNG

(3) Clipping mask

We can overlay an image over another layer using a technique called Clipping mask. The image will be visible on white part of the background and will be invisible on the black part of the background.

Clipping Mask – Example 1

Let’s open an image in Photoshop application. Also, set the Background layer as white layer.

Clipping mask example 1.PNG

Hide image layer and select the background layer. Then select Rectangular shape tool and draw a shape.

Rectangular shape.PNG

We get the rectangular shape as shown below.

See Rectangular shape.PNG

Now right click on the main image and create clipping mask.

Create Clipping mask.PNG Create Clipping mask 1.PNG

Now press Ctrl + T on the rectangular shape to reposition it.

Reposition Rectangular shape.PNG

Give some Drop shadow and Outer Glow on the frame by setting Layer style. To set Layer style, right click on the frame layer and select Blending options.

Layer style on shape.PNG

Now duplicate girl’s image and frame image.

Duplicate shape 2.PNG

Select the Frame copy and then transform it. To transform press Ctrl + T.

Move the shape 2.PNG

Press Enter to accept the changes. Again, duplicate Frame and girl’s image.

Duplicate shape 3.PNG

Repeat the process until we get the below result.


Clipping Mask output:

Clipping mask output in Photoshop.PNG

Clipping Mask – Example 2

Let’s open the image in Photoshop application with white background layer.

Clipping mask example 2.PNG

For time being, hide the girl’s image layer and select Background layer. Then select custom shape tool and draw a shape as shown below:

Custom shape on canvas.PNG

We get a new layer created for the shape layer.

New shape layer.PNG

Now select girl’s image layer and right click on it to select “create clipping mask”.

Create Clipping mask 2.PNG

Clipping Mask output:

Clipping mask output in Photoshop 2.PNG





Copyright © go4university.com, 2018-2020. Copyright notice