Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. 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

This is a little hard to explain, so bear with me. I'm wanting to save out a series of diagram images in a sprite sheet for a website. Right now, I have it so that I have a white image with "holes" cut into it that make the diagram. I put a background behind that image and it colors the "holes."

The problem is, the parts not colored are white, and this sometimes looks bad if the sprite sheet goes against a non-white background (so it's a white box with a colored diagram on it).

Is there a way to save an image so that the white part could be transparent (or any color), but maintain the ability to also customize the diagram color?

I'm not sure this is possible, since the only way I can think of requires layers (which can't be saved for the web) but I'd appreciate any help! Thanks!

share|improve this question
Could you provide example pictures of what you're working with and what you're trying to do? – JohnB Aug 16 '13 at 18:33
Is there some reason you don't just color the shapes in an image as opposed to creating the image mask? – Scott Aug 16 '13 at 18:40
The Image lets say the Orange Part is the background (white) and the text in it are the transparent images, you want to extract the transparent images alone, am i right ? – jayeshkv Aug 17 '13 at 4:34

Instead of using a basic white layer with holes in it, I would use a black layer mask with white "holes" in it.

Try converting one of your existing sheets this way:

  • Ctl/Cmd-Click on the Layer Panel thumbnail of your white layer to select by Opacity.

  • Ctl/Cmd-Shift-I to invert the selection.

  • Target your colored background layer.

  • Click the New Layer Mask icon at the bottom of the layers panel.

  • Delete the white layer unless you need to keep it for some other purpose, in which case hide it.

Your "colored background" layer is now the diagram layer, with everything else on the layer transparent, so you can put any other background you want behind it.

share|improve this answer

Make the layers you want to get saved visible. I usually do this by creating a new file and dragging and dropping all the layers to this new file. Make sure to have all the other layers to be invisible.

Go to File->Export->Export Layers to Files.

Click the checkbox next to "Visible Layers only"

Select your file saving type as PNG.

This works exactly like sprites with greater precision and saves time.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.