Michdd Posted April 4, 2009 Share Posted April 4, 2009 Is it possible to set more than one imagecolortransparent() on a single image? It seems when I set more than one, only one of the two work. Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 4, 2009 Share Posted April 4, 2009 That is because transparency is created by defining only one color value as transparent. Partial transparency is available in PNG, using Alpha channels, however an image with an alpha channel is a completely different beast. Alpha channels involve the combination of a per pixel Alpha blending value. So the first thing you need to know is that alpha channels in the png spec only work with png images that use 8 or 16 bit color. Rather than specify a color that should be rendered transparent, an alpha channel acts as a mask value on a per pixel basis, indicating what opacity the pixel should have. This is simplifying the question a bit, because png's using an index table, can also specify an alpha value for a particular color in the color table index, which is probably the closest thing to what you originally inquired about. There's an example of merging images to create a watermark effect in the php manual that touches upon some of this material: http://us.php.net/manual/en/image.examples.merged-watermark.php Quote Link to comment Share on other sites More sharing options...
Michdd Posted April 4, 2009 Author Share Posted April 4, 2009 I don't think that solves my problem. The transparency I need is 100% transparency, for more than one color. Is this not possible? Quote Link to comment Share on other sites More sharing options...
Michdd Posted April 4, 2009 Author Share Posted April 4, 2009 Anyone got an answer? Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 6, 2009 Share Posted April 6, 2009 I did answer you, if you read what I said. What is it that you didn't understand about the fact that you can only have one color be transparent? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.