Jump to content

[SOLVED] PHP GD adjust transparency after imagecreatefrompng()


xekon

Recommended Posts

How do you change transparency if your source was not a fill color? In this example the transparency is changed for a fill color but I dont see how you could use this function to change the transparency if your source is from an image: http://is.php.net/ma...locatealpha.php The only thing I could see that might be able to be manipulated to work is the imagefilter() function. however none of the filtertype parameters are for transparency directly, but transparency can be passed to the other filtertypes, so I was thinking maybe the transparency could be changed in a roundabout way or maybe I am totally off and there is a better way to use PHP GD to adjust transparency. http://is.php.net/ma...imagefilter.php Any idea, suggestions appreciated :)EDIT: DOH! should have read the user comments on the bottom of the imagefilter page, somebody posted a custom function for transparency on the fly. EDIT: Custom Function WORKS PERFECT! exactly what I needed

Edited by xekon
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...