Categories
Concrete

How to add a layer mask in photoshop

Photoshop CS5 allows you to change the size of an image in a couple of different ways. But many of these methods will change the size of the entire image, as opposed to just a single layer of that image. So if you are working on a multi-layered project and want to adjust the size of just one of those layers, then you may be wondering if that is possible.

Fortunately you can resize layers in Photoshop by taking advantage of the Free Transform Tool. Our guide below will show you how to select a single layer in your Photoshop project and resize that layer with just a few short steps.

Here is how to resize a single layer in a Photoshop image –

  1. Open your layered image in Photoshop CS5.
  2. Click the layer that you want to resize from the Layers panel.
  3. Press Ctrl + T (Windows) or Command + T (Mac) on your keyboard.
  4. Click inside the W and H fields at the top of window to adjust the width and height of the layer, respectively. You can also click one of the boxes around the layer and manually drag it to resize.
  5. Press the Enter key on your keyboard when you are finished.

These steps are also repeated below with pictures –

Step 1: Open your layered file in Photoshop CS5.

Step 2: Click on the layer that you wish to modify in the Layers panel. If you do not see the Layers panel, then you can press F7 on your keyboard to display it.

How to add a layer mask in photoshop

Step 3: Press Ctrl + T (Win) or Command + T (Mac) to launch the Free Transform Tool. You can also launch the Free Transform Tool by clicking Edit at the top of the window, then clicking Free Transform Tool.

How to add a layer mask in photoshop

Step 4: Click inside the W or H field at the top of the window to enter a new value and resize the layer that way. Note that you will need to change each value to the same number if you wish to keep the layer proportions the same. For example, I have chosen to make the layer 50% of its original size in the image below. You can also resize the layer by dragging one of the handles along the perimeter of the layer.

How to add a layer mask in photoshop

Step 5: Press the Enter key on your keyboard when you have finished resizing your Photoshop layer.

Do you have trouble keeping track of which element of your image is on what layer? Learn how to rename layers in Photoshop and make your navigation a little simpler. It can also make things easier for other people that might be working on your file later.

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.

He specializes in writing content about iPhones, Android devices, Microsoft Office and many other popular applications and devices.

Adding a layer to an image in Photoshop CS5 is as easy as clicking a few buttons. You can have a very high number of layers in one image in Photoshop, and they are so useful as a means to separate image elements that it is easy to add an excessive amount of layers. You may find yourself in a situation where you want to see how your picture looks without the elements that are included on one layer, or you might be saving multiple versions of an image, and one of those versions needs to be saved without a layer. You might have considered deleting the layer, performing the save action, then undoing the layer deletion, which would be a perfectly acceptable solution. However, you run the risk of a program error or crash accidentally closing your image and you losing the layer that was deleted. You have another option, which you can execute by learning how to hide a layer in Photoshop CS5. It is the simplest and best way to remove a layer from an image without losing the data contained in the layer.

Hiding Photoshop CS5 Layers

By using the method described in this tutorial, you will be able to take an image with multiple layers, select a specific layer, then hide that layer from view. The layer and everything contained within it will still be accessible, but the layer will not show until you choose to unhide it. This is a good solution for testing changes to your image without deleting or losing image elements that you may have spent a lot of time working on.

Begin by opening your image in Photoshop. You will need to use the Layers panel for this exercise so, if it is not visible at the right side of the window, press the F7 key on your keyboard to display it.

How to add a layer mask in photoshop

Click the layer on the Layers panel that you want to hide.

Click Layer at the top of the window, then click the Hide Layers option.

How to add a layer mask in photoshop

You will note that command includes the plural of the word “Layer”, which means that you can choose to hide multiple layers at once. This can be accomplished by holding down the Ctrl key on your keyboard as you click each layer on the Layers panel that you want to hide.

Additionally, you can also quickly hide a layer by clicking the eye icon at the left side of the layer that you want to hide.

How to add a layer mask in photoshop

You can restore or unhide a layer at any time by clicking the empty box where the eye icon used to be.

Matthew Burleigh has been writing tech tutorials since 2008. His writing has appeared on dozens of different websites and been read over 50 million times.

After receiving his Bachelor’s and Master’s degrees in Computer Science he spent several years working in IT management for small businesses. However, he now works full time writing content online and creating websites.

His main writing topics include iPhones, Microsoft Office, Google Apps, Android, and Photoshop, but he has also written about many other tech topics as well.

This sample file is an Adobe Stock asset you can use to practice what you learn in this tutorial. If you want to use the sample file beyond this tutorial, you can purchase a license on Adobe Stock. Check out the ReadMe file in the folder for the terms that apply to your use of this sample file.

What you learned: Layer masking basics

What is a layer masking?

Layer masking is a reversible way to hide part of a layer. This gives you more editing flexibility than permanently erasing or deleting part of a layer. Layer masking is useful for making image composites, cutting out objects for use in other documents, and limiting edits to part of a layer.

You can add black, white, or gray color to a layer mask. One way to do that is by painting on the layer mask. Black on a layer mask hides the layer that contains the mask, so you can see what is underneath that layer. Gray on a layer mask partially hides the layer that contains the mask. White on a layer mask shows the layer that contains the mask.

Create a layer mask

  1. Select a layer in the Layers panel.
  2. Click the Add layer mask button at the bottom of the Layers panel. A white layer mask thumbnail appears on the selected layer, revealing everything on the selected layer.

Add black to a layer mask to conceal

Adding black to a layer mask hides the layer that contains the mask.

  1. In the Layers panel, make sure there is a white border around the layer mask thumbnail. If there is not a white border, click the layer mask thumbnail.
  2. Select the Brush tool in the Toolbar. In the Options bar, open the Brush Picker and choose the size and hardness of the brush.
  3. Press D to set the default colors of white and black in the Toolbar. Then press X to switch the colors, so black becomes the foreground color.
  4. Paint over the image, which adds black to the layer mask. Black on the layer mask hides the layer with the mask, so you can see the layer below or the checkerboard pattern that represents transparency.

Add white to a layer mask to reveal

Adding white to a layer mask shows the layer that contains the mask. You can paint with white on a layer mask to reveal content you had previously concealed with black on the layer mask.

  1. Press X to switch the foreground and background colors in the Toolbar, so white becomes the foreground color.
  2. Paint over hidden areas of the image. This adds white to the layer mask, bringing back into view corresponding areas of the masked layer.

Fine-tune the layer mask with black, white, and gray

Switching between black and white as you paint on a layer mask is a flexible way to fine-tune the mask edge. If you use a soft brush, the edges of the brush will apply shades of gray, partially hiding that part of the layer with the mask.

This sample file is an Adobe Stock asset you can use to practice what you learn in this tutorial. If you want to use the sample file beyond this tutorial, you can purchase a license on Adobe Stock. Check out the ReadMe file in the folder for the terms that apply to your use of this sample file.

What you learned: Use an adjustment layer mask to edit part of a photo

An adjustment layer is a flexible way to add an adjustment to an image without directly changing the image itself. Every adjustment layer comes with a built-in layer mask. You can add black, white, or gray to an adjustment layer mask to target the adjustment to a particular part of a photo.

Add an adjustment layer

  1. Select an image layer in the Layers panel.
  2. Click the Create new fill or adjustment layer button at the bottom of the Layers panel. Choose Hue/Saturation in the pop-up menu. A Hue/Saturation adjustment layer, with a white layer mask thumbnail, appears in the Layers panel above the layer you selected. The Properties panel displays Hue/Saturation controls for this adjustment layer.
  3. In the Properties panel, drag the Saturation slider to the right to increase color saturation. This adjustment now affects the entire photo on the layer below.

Add a black to white gradient to the adjustment layer mask

Black on an adjustment layer mask hides the adjustment; gray partially shows the adjustment; and white shows the adjustment. One way to add black, gray, and white to any layer mask, including an adjustment layer mask, is with a black to white gradient.

  1. In the Layers panel, make sure there is a white border around the layer mask thumbnail. If there is not a white border, click the layer mask thumbnail.
  2. Press D on the keyboard to set the default colors of white and black in the Toolbar. Press X to switch the color boxes so black is the foreground color and white is the background color.
  3. In the Toolbar, select the Gradient tool.
  4. In the Options bar, make sure the Gradient option displays a black to white gradient. If it does not, click that option to open the Gradient Editor, select the Foreground to Background gradient preset, and click OK.

    Tip:
    If you want to add multiple gradients to the same layer mask, select the Black to Transparent gradient preset in the Gradient Editor.

The white part of the gradient on the layer mask shows the adjustment at full strength on the underlying photo layer; the shades of gray on the layer mask gradually hide the adjustment; and the black on the layer mask hides the adjustment completely. This creates a gradual transition between the areas of the photo that are affected and not affected by this adjustment layer.

This sample file is an Adobe Stock asset you can use to practice what you learn in this tutorial. If you want to use the sample file beyond this tutorial, you can purchase a license on Adobe Stock. Check out the ReadMe file in the folder for the terms that apply to your use of this sample file.

What you learned: Make a creative composite by combining images using a layer mask

Add a layer mask

  1. Start with a document that has at least two images, each on a separate layer. Select the top image layer in the Layers panel.
  2. Click the Add layer mask button in the Layers panel. This adds a white layer mask to the selected layer. You can still see everything on the layer with the mask, because the mask is white.

Paint on the layer mask with black, white, and gray

  1. In the Layers panel, make sure there is a white border around the layer mask thumbnail. If there is not a white border, click the layer mask thumbnail.
  2. Select the Brush tool in the Toolbar. In the Options bar, open the Brush Picker to set brush size and hardness. Drag the Hardness slider toward the left to create a soft brush tip.
  3. Press D and then press X on the keyboard to set the foreground color to black and the background color to white.
  4. Paint over the image in the document window to add black to part of the layer mask. The black hides the corresponding part of the layer that contains the mask, so the image on the layer underneath shows through. Soft edges of the brush apply gray to the layer mask, creating a gradual transition between the layered images.
  5. If you hide more of a layer than you intended to, press X on the keyboard to switch the foreground color to white. Then paint over hidden areas of the layer that contains the mask. This adds white to the mask, bringing those areas back into view.

Tip: A quick way to change brush size as you paint is to press the right bracket key on the keyboard to increase brush size or press the left bracket key to decrease brush size.

Tip: Reducing the brush Flow value in the Options bar allows you to build up shades of gray as you paint with black on a layer mask. Shades of gray on a layer mask partially hide the layer that contains the mask.

Save your work with layers

  • Save the image in .PSD or .TIFF format to retain layers and layer masks for future editing.

Back to: Layer mask basics | Up next: Layer masks and selections

Using a layer mask in Photoshop may seem something difficult or advanced for beginners. However, these are easy and simple to use. It has several creative and practical implementations, which is why every photo editor must learn how to use it.

Photoshop layer masks can help with transparency control. This means masking can hide the areas of a layer and allow the picture information to show through from the lower layers. So, masking photo layers can help you to hide and reveal certain portions in the layers that you want.

Are you wondering why to use it as you can do the same with an eraser tool?

Indeed, the eraser tool can help with removing specific portions in the images. But, the changes will remain there forever. In simpler terms, you cannot retrieve the parts you have eliminated ever again.

However, with layer masking, it is possible to leave the pixel data of the original layer unharmed. So, you can experiment with transparency and do not even have to worry about creating a mess since it can be altered.

The article is a step-by-step tutorial to guide you through the process of adding a layer mask in Photoshop. We will also help you making a few modifications to suit your needs.

How to Add a Layer Mask in Photoshop?

As discussed earlier, Photoshop layer masking can help with hiding and showing layers. However, apart from that, it can be also used to base the masking on a particular transparency or selection. Finally, these can be painted carefully to hide specific portions and showcase the layers beneath it.

Steps to hide or show entire layer while masking pictures

Step 1: Unselect if any selected parts are there in the image by choosing Select > Deselect.

How to add a layer mask in photoshop

Step 2: Go to the Layers panel and choose a layer or group.

How to add a layer mask in photoshop

Step 3: For hiding the entire layer:

  • Press Alt-click (for Win) or Option-click (for Mac)
  • Click on Add Layer Mask
  • Select Layer > Layer Mask > Hide All.

How to add a layer mask in photoshop

For revealing the whole layer:

  • Go to the Layers panel and click on Add Layer Mask
  • Now, select Layer > Layer Mask > Reveal All.

How to add a layer mask in photoshop

Steps to add layer masks for hiding only a part of the layer

Step 1: Go to the Layers panel and choose a layer or group.
Step 2: Choose the desired area for masking.
Step 3: Select the New Layer Mask present in the Layers panel for revealing the desired section.

Click on Alt-click (for Win) or Option-click (for Mac), and then select the Add Layer Mask button from the Layers panel to hide the selection.

Select Layer > Layer Mask > Hide Selection or Reveal Selection.

Step 4: If you wish to edit the layer transparency further, then follow the below steps for creating a mask.

  • Select Layer from the Layers panel.
  • Now, click on Layer > Layer Mask > From Transparency.

How to add a layer mask in photoshop

In this case, the transparency will turn into an opaque color, which will be hidden by the masking created newly. The color may vary depending on the filters and processing applied to the layers. The companies offering photo editing services widely use this technique for 3D workflows or videos.

Steps to apply a layer mask from another layer

To apply a layer mask from another layer, perform either of the following steps.

  • Drag the mask for moving it from one layer to another.
  • Click on Alt-drag (for Win) or Option-drag (for Mac) for duplicating the mask and apply it from one layer to another.

How to unlink the layer and mask?

A layer or group will be always linked to that of the layer or vector mask. This is also indicated by the link icon that is present in the Layers panel between the thumbnails. So, when you move either the mask or layer with the help of the Move tool, both move together. The unlinking basically helps with moving them and shifting the boundaries of the masking independently.

How to add a layer mask in photoshop

Here’s how you can do it.

Step 1: Go to the Layers panel and click on the link icon.
Step 2: For reestablishing it again, go to the Layer’s panel and click between the thumbnails of layer and mask path.

How to disable or enable the layer masking?

Here’s what you need to do if you want to enable or disable the layer or vector masking:

How to add a layer mask in photoshop

Step 1: Choose the desired layer in the masking which you want to enable or disable.
Step 2: Go to the Properties panel.
Step 3: Now, click on the Disable/Enable Mask button.

Step 1: Go to the Layers panel.
Step 2: Shift-click the thumbnail of layer mask.

Step 1: Choose the desired layer you want to enable or disable.
Step 2: Select Layer > Layer Mask > Disable/Enable.

How to apply or delete the layer masking?

During pixel masking, remember that the pixels are not deleted but hidden. However, it is possible to apply or delete the hidden parts of the layer permanently. Below are the steps you need to follow:

How to add a layer mask in photoshop

Step 1: Go to the Layers panel and select the desired layer.
Step 2: For applying the masking:

  • Go to the Properties panel and choose the Apply Mask icon.

For deleting the masking:

  • Go to the bottom of the Properties panel, and click on the Delete button.

Alternatively, the Layer menu can be also used to apply or delete the layer masks.

From this, we conclude that layer masking offers more flexibility. With it, you can easily hide different parts of the layer without even affecting a single pixel in the photograph. Besides, there is nothing permanent when you carry out image masking using Photoshop. It means you can redo and rework again if something goes wrong. This gives a lot of confidence to beginners while editing.

Alternatively, you can also choose a company offering clipping mask services. This option is suitable for those who are not interested in carrying out the task themselves. These companies usually have ample knowledge to accurately use a layer mask in Photoshop and produce the best outcomes.

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshopWhat You’ll Be Creating

In this Photoshop Masking quick tip tutorial, we will learn what a Layer Mask is, what it does, and how to create a Mask in Photoshop!

How to add a layer mask in photoshop

You can also find out more about how to Mask in Photoshop with these tutorials:

Or find everything you need to know about how to use Photoshop, all in one place. This comprehensive beginners’ Photoshop course with Daniel Scott is the ideal way to get up to speed quickly. There’s even a dedicated lesson on layer masks.

What You Will Need

You will need the following image in order to follow along with this tutorial.

1. What Are Layer Masks?

Layer masks are your go-to tool when doing photo composites or manipulations! You can add a mask to a layer and then use that mask to hide, or “mask,” portions of the layer.

Masking is different from erasing as you aren’t deleting anything, but hiding it. Anything you mask can be brought back at any time! Let’s get to learning how to make a layer mask in Photoshop.

2. How to Use Layer Masks

Below, I will walk you through a simple example of how to add a layer mask in Photoshop.

Step 1

Create a New Layer over a background. I’ll be using this Night Sky image.

Create a shape using the Shape Tool.

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshop

Step 2

With the shape selected, click on the Add Layer Mask button found at the bottom of the Layers panel, right in the middle. The icon is of a square with a circle in the middle.

A white box will appear next to your layer icon.

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshop

Step 3

Click the layer mask, the white box that appeared, to make sure it’s active. This is your Photoshop mask!

Now, with a Brush set to black, you can mask out any part of that shape.

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshop

Step 4

You can then mask things back in using the color white! Remember, nothing is ever really gone.

You use black to erase and white to recover. You can even use shades of gray; the darker the gray, the more it will erase.

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshop

Below, I created some star-shaped selections and then masked them out with a black brush.

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshop

Step 5

If you move your layer around, your mask will follow and stay attached, indicated by the Chain Link icon located between the layer and layer mask icons.

However, you can also Unlink the layer and the layer mask, allowing you to move the layer and layer mask around independently, depending on which one you have active.

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshop

Step 6

Finally, if for any reason you want to permanently apply your layer mask, you can Right-Click > Apply Layer Mask on your layer mask.

Once a layer mask is applied, whatever is masked out will become permanently deleted, the layer will turn back into a standard rasterized layer, and you are free to add a new layer mask.

And There You Have It!

We’ve learned how to create a layer mask in Photoshop! Layer masks are what make photo composites and manipulation possible, allowing us to blend dozens of images to create one cohesive new piece of art! The possibilities are endless.

So, as always, keep experimenting with different techniques, continue learning how to mask in Photoshop, and don’t forget to post your version below, along with any questions, comments, or critiques!

How to add a layer mask in photoshopHow to add a layer mask in photoshop How to add a layer mask in photoshop

Apply those new Photoshop Layer Mask skills by trying out these tutorials which utilise Layer Masks:

How to add a layer mask in photoshop

Layer masks are one of the most important tools within Photoshop. They not only help you to create selections but allow you to refine layers and individual adjustments. When you add selections or duplicate layer masks, it’s not uncommon to see the opposite of what you want. That’s why learning how to invert a layer mask is so useful.

In this tutorial, you’ll learn how to invert a layer mask in Photoshop to save yourself a ton of time. Rather than remaking the entire layer mask, you can use a few shortcuts and techniques to invert the mask you’re already using. Let’s get started!

How To Invert A Layer Mask

Before you do anything, make sure your layer mask is selected by clicking on the mask. A white box will appear around the layer mask, indicating that it’s selected. Now any adjustments you make will affect the mask and not your image!

The easiest way to invert a layer mask in Photoshop is with the keyboard shortcut Command + I (Mac) or Control + I (PC).

How to add a layer mask in photoshopHow to add a layer mask in photoshop

This will switch everything to the opposite color in your layer mask. Now black becomes white and white becomes black, swapping which areas are transparent.

Rather than using a keyboard shortcut, you can also go up to Image > Adjustments > Invert to achieve the same result.

How To Invert A New Layer Mask

When you create a new layer mask, you may want it to be completely black (aka transparent) to start. By default, when you make a new layer mask, it’s 100% white (visible), which means you need to invert the mask afterward.

Rather than creating a new layer mask and using the invert shortcut above, there’s an even better technique.

Select the layer you want to add your layer mask to. Next, hold Option (Mac) or Alt (PC) and click on the layer mask icon to create a new mask.

How to add a layer mask in photoshop

Rather than having a white mask, this will create a black, inverted mask from the get-go.

How to add a layer mask in photoshop

Using this easy technique saves you from the extra step of inverting your layer mask with a keyboard shortcut. Now it’s inverted and ready to go the moment it’s created!

How To Duplicate And Invert A Layer Mask

Now I’ve already talked extensively about how to duplicate layer masks in another post, but now let’s add a twist. Rather than just duplicating or inverting a layer mask, you can do it all at once.

How to add a layer mask in photoshop

Just hold Option + Shift (Mac) or Control + Shift (PC) and click and drag your layer mask to a new layer. This will simultaneously duplicate and invert your layer mask at the same time!

How to add a layer mask in photoshop

This trick is another huge time saver and prevents you from needing to create an entirely new layer mask.

More Photoshop Tutorials For You:

Conclusion

Learning how to invert a layer mask in Photoshop is an essential skill for any creative. It not only saves time but makes it so much easier to get the proper mask. By remembering the shortcuts and tips you learned here, you’ll never have to worry about how to invert a layer mask again!

Want more tutorials like this? Subscribe to our weekly newsletter for more photography, and photo editing tips delivered straight to your inbox!

Isha Misra wrote this article as part of their Bachelor of Architectural Design 3rd year elective, MADAboutMADA. In the elective, students are introduced to digital media and how it can be relevant to the architecture, design and art professions.

Masking layers can be particularly useful for architecture projects such as collages and editing renders. The tool allows you to hide parts of an image without having to delete it which gives you a lot more flexibility and confidence when using photoshop as you can make changes without having to reload the entire image.

What is a layer mask?

Applying masks to a layer is a reversible way to hide part of a layer. This method allows for more editing flexibility as opposed to permanently erasing or deleting part of a layer.

What you need to know:

Layer masks can be painted either black, white or grey and each colour has a particular function.

  • BLACK to conceal: Adding black to a layer mask hides the layer that has the mask and shows what is in the layer below.
  • WHITE to reveal: Adding white to a layer mask simply shows the layer with the mask.
  • GREY is used for level of opacity: Adding different shades of grey results in varying opacity of the layer with the mask.

In this tutorial, we will learn how to create this image by applying layer masks.

How to add a layer mask in photoshop

Materials:

  • Adobe Photoshop
  • The following two images:

Procedure:

Select the two images you want to mask and arrange them in two separate layers.

How to add a layer mask in photoshop

Select a layer in the Layers panel and click the ‘Add layer mask’ button at the bottom of the panel. A white layer mask thumbnail will appear on the selected layer, revealing everything on the selected layer.

How to add a layer mask in photoshop

Click on the layer with the tree and use the Magic Wand Tool to select the tree silhouette. There should be a dashed white line to indicate the selection.

How to add a layer mask in photoshop
How to add a layer mask in photoshop

Now, the aim is to replace the silhouette of the tree with the image of the earth, therefore the layer with the mask needs to be concealed. To do this click on the layer mask again and use the Paint Bucket Tool and paint the selection black. *Ensure that the FOREGROUND colour is BLACK.

How to add a layer mask in photoshop

You have successfully applied your first layer mask! The resulting image should look like this:

How to add a layer mask in photoshop

Save the image in .psd or .tiff format to retain the layers and layer mask for future editing.

The masking tool can be applied to many layers. Simply, create new layers and then use steps 1-4 to create you layer mask.

I’ve got a bunch of puppies i need to mask in the same way as below, where each puppy will be within a shadowed circle:

How to add a layer mask in photoshop

I got the first one working using a layer mask, but now i want an easy way to apply the same mask layer to all my other puppies, and I can’t figure out how. The current mask is tied to this specific layer, like so:

How would I create a single mask that I could apply across many puppy pics, and modify in one place if need be.

Update on this:

I discovered I could apply a mask to a group, like so- however, I can’t apply filters on the group-level mask. So I’m closer, but not there yet.

How to add a layer mask in photoshop

2 Answers 2

Place the circle shape layer under your images in the Layers panel.

Then click between the circle layer and the image on top of it while pressing alt key. This will use the circle layer as a clipping mask.

You can add layer styles into the circle layer and the images on top of it in the clipping mask, will use those same styles.

In my example image I have added an empty layer on top of the image layer. That way, if you always select the top most image layer and place a new image on top of that, you don’t have to separately add that new image into the clipping mask ( and you can also select one or more images outside the clipping mask and just drop them below the empty layer and they will all be added to the clipping mask ). How to add a layer mask in photoshop