Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question

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.

share|improve this answer
Can you please tell me how to do 3? – mahboudz Nov 27 '09 at 11:26
I added to the answer :) – Skunk Nov 27 '09 at 11:54

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.

share|improve this answer
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 Nov 27 '09 at 9:20
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 Nov 27 '09 at 11:31
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. – Skunk Nov 27 '09 at 11:57
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 Nov 27 '09 at 12:18
Problem with that last method is that it's destructive. You 'physically' delete the pixels, while with a mask you just hide them. – Skunk Nov 27 '09 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .