Photoshop masking: Drawing a shape on top of an image, and masking what is outside the shape

0

I have an image that I want to turn into a button. I want to draw a rounded rectangle on top of the image. I want to then be able to see the image inside the button, and outside of the button, I want transparent pixels.

I just can't seem to figure out how to create a mask that can turn transparent what is behind parts of it, and show through the rest.

I have a feeling that this is incredibly simple to do, if you happen to be a regular Photoshop user.

Can someone please enlighten me? Thanks!

mahboudz

Posted 2009-11-27T09:05:59.783

Reputation: 113

Answers

2

You cannot "fill" an area with transparent pixels if you have several other layers below it. What you could do is merge the layers you need in a new layer on top and hide all the layers below that one. Then use the mask to hide the section of the layer you want transparent.

In short:
1. Apply Image in a new layer (or merge to new layer)
2. Hide all the other layers below the top one
3. Add mask, hide the section you want transparent

To add a mask, select the right layer and draw a selection. Then go to Layer > Layer Mask > Reveal Selection.
This will hide the parts of the layer that are not selected.

Kablam

Posted 2009-11-27T09:05:59.783

Reputation: 137

Can you please tell me how to do 3? – mahboudz – 2009-11-27T11:26:49.890

I added to the answer :) – Kablam – 2009-11-27T11:54:22.313

1

Sounds like you just want to invert the mask. Ctrl+I in pretty much any Windows photo app, so presumably Applekey (command?)+I in OSX.

Bonus

Posted 2009-11-27T09:05:59.783

Reputation: 1 192

Not quite. The inverted mask (say a mask I draw with the lasso or selection tool, and then I delete the pixels inside) will show through what is inside the shape but the outside of the shape would be filled with non-transparent white pixels. No? – mahboudz – 2009-11-27T09:20:27.833

I know how to use the lasso or rectangular marque to select an area. Is that the mask? And when you say hide, do you mean deleting the selection's interior or exterior, so you can see through the now deleted pixels? – mahboudz – 2009-11-27T11:31:01.643

With the lasso or rec. marquee you make a selection. You can use this selection in several ways. The selection itself is not final, the actions you can do with the selected area can be final. After you've selected an area, you can make it a mask by selecting the right options in PS. – Kablam – 2009-11-27T11:57:07.223

Misunderstood what you were trying to do. If I've got it right now, you just need your image on layer A, create a new layer B and draw the rounded rectangle, magic wand around (or within or invert, as required) that, select layer A and delete the selected area, then merge the two layers if you want the rectangle as a border, or just delete layer B to retain a rounded image with a transparent border. – Bonus – 2009-11-27T12:18:16.463

Problem with that last method is that it's destructive. You 'physically' delete the pixels, while with a mask you just hide them. – Kablam – 2009-11-27T12:41:24.333