Berserk87 Posted March 28, 2006 Share Posted March 28, 2006 i cant figure out how to make an image semi transparent/chage its opacity/partially see through... like if u wanted to put a watermark on an image in php quickly or something. ive changed the opacity in photoshop, but when i use it in php its not transperant at all. :unsure: coudl someone plz tell me the trick to this. Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/ Share on other sites More sharing options...
0 the_mole001 Posted March 28, 2006 Share Posted March 28, 2006 I'm not exactly sure how you mean, but just so you know, if you're using IE6 it dosen't support .png transparency. However, if your looking for a CSS method try adding: style="filter: alpha(opacity=50); -moz-opacity: 0.5;" inside the <img /> tag. It basically gives the image 50% opacity in mozilla browsers and IE. Of course if the settings aren't for you, you can always play around with it. Hope this helps answer your question in some way. Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/#findComment-587358103 Share on other sites More sharing options...
0 mootymoots Posted March 28, 2006 Share Posted March 28, 2006 You can do this with the GD library and the imagecopymerge function. check it out on php.net Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/#findComment-587358276 Share on other sites More sharing options...
0 metal_dragen Veteran Posted March 28, 2006 Veteran Share Posted March 28, 2006 This code will enable alpha transparency for an image created in GD. I know it seems counter-intuitive that the imagealphablending() function is false, but that is correct - true enables "blending" mode which is similar to dithering, and false disables it so each pixel is copied with alpha channel information. $image_p = imagecreatetruecolor($width, $height); imagesavealpha($image_p, true); imagealphablending($image_p, false); Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/#findComment-587358445 Share on other sites More sharing options...
0 Berserk87 Posted March 28, 2006 Author Share Posted March 28, 2006 if u didnt get what i meant i made an example. there is two images there, the background and the white rectangle, see how u can see the background through the rectangle?? thats what i want to do in php. and ill try the other examples and stuff u guys gave me. Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/#findComment-587359419 Share on other sites More sharing options...
0 TaRaKa Posted March 28, 2006 Share Posted March 28, 2006 have you tryed googleing your problem Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/#findComment-587359580 Share on other sites More sharing options...
0 Berserk87 Posted March 29, 2006 Author Share Posted March 29, 2006 TaRaKa said: have you tryed googleing your problem thats the first thing i do, mabye i didnt look hard enough though. Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/#findComment-587360747 Share on other sites More sharing options...
0 OmegaHack Posted March 29, 2006 Share Posted March 29, 2006 Maybe this will help. http://www.scit.wlv.ac.uk/appdocs/php/func...hablending.html Link to comment https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/#findComment-587360755 Share on other sites More sharing options...
Question
Berserk87
i cant figure out how to make an image semi transparent/chage its opacity/partially see through...
like if u wanted to put a watermark on an image in php quickly or something.
ive changed the opacity in photoshop, but when i use it in php its not transperant at all. :unsure:
coudl someone plz tell me the trick to this.
Link to comment
https://www.neowin.net/forum/topic/447112-opacitysee-through-images-in-php/Share on other sites
7 answers to this question
Recommended Posts