Convert foreground motif to degrees of transparency?
I have a 24-bit PNG where the motif is a subtle pattern. The pattern itself is in light greys, i.e. the background color of the PNG is
#eee and the pattern is in a range of slightly darker greys.
I would like to convert the foreground motif to a range of transparency levels. In other words, my plan is to have a web page with solid colors defined via CSS, and lay the image over these colors, to provide a repeating pattern for several colors using just one image.
I can find plenty of tutorials on just making the background transparent, but how do i convert the foreground motif to degrees of transparency?
I'm a complete newbie to graphics design software. Adobe Photoshop 5 is available, and I could also install freeware software for Windows (like Windows Gimp).
(I have google this, and there are several related questions on this site -- fx "Add transparency to an existing PNG". So far, what I have found generally addresses changing one solid background color to transparent, which isn't what I'm looking for.)
Update: Here is the original PNG which I'm trying to convert:
(NB: This image is licensed, use of or redistribution by others is not permitted):
You can try Colour to alpha from Colours menu in GIMP and then select the darkest colour in this image to set it to alpha. Here is the result I've got(image is barely visible here, right click to view image or download):
And using it as a background for a HTML page with background colour set to
#aa00cc I've got this result:
First thing you'll have to keep in mind is that your pattern color, however subtle, should be kept neutral (preferably shades of gray), to make sure it'll match as many â€œbackgroundâ€ colors as possible.
Putting that aside, there's a plethora of ways to achieve what you want to do. In this case, I think, the simplest method (and best at the same time) would be to:
- Copy your image to a new layer (it won't work if it'll remain a â€œBackgroundâ€ layer, since â€œBackgroundâ€ in Ps is always completely opaque). This can be done with e.g. Ctrl+J (Cmd+J if that's your boat ;))
- Double-click the layer to get to â€œLayer Styleâ€ window. By default you should land at â€œBlending Optionsâ€ section. There, at the bottom, you should see two sliders, by default filled with black to white gradient. Upper should be marked as â€œThis layerâ€. If you want to make white parts of your image transparent, move the right slider. You should see â€œcheckerboardâ€ showing up in the brightest places of your pattern. It's all fully transparent or opaque right now, but you can add â€œintermediateâ€ transparency stages by Alt clicking at the slider. It'll then split in two, making colors between the slider parts â€œsemi-transparentâ€. You can read more at this tutorial.
- That's pretty much it! If you want to see how your new transparent pattern will look with different background colors, add a colored layer underneath your pattern (I recommend â€œSolid Colorâ€ adjustment layer, since it will make changing fill color a breeze).
- Make sure you have only you transparent pattern visible and export it to transparent PNG. You can do it in number of ways, but my advice is to use â€œSave for Webâ€ functionality, since you'll be able to see how your PNG will look like depending on given parameters before it'll be exported.