PNG image transparency in PHP
Posted: Wed Apr 26, 2006 4:09 pm
I need to dynamically generate some PNG images for my site. They're pretty simple--a transparent background with some lines, such as this image:

I have a Java program that does this, but my hosting company recently upgraded their PHP version and now any java call (even a HelloWorld program) through the php system function returns an "unable to reserve enough memory for the VM" error. My attempts at a workaround in order to call the Java program some other way have been unsuccessful (even though I have no problem calling it through SSH--they don't have the ssh module installed for php, or I'd try it that way.)
So, I need to figure out how to write this in PHP. I didn't do it in PHP in the first place because my readings through the image functions led me to believe that I couldn't get the desired effect. All I need to do is this:
Draw antialiased lines on a transparent image, and have the antialiasing affect the alpha layer.
Can someone please provide me with some sample code or direction on how to do this? I've searched extensively and haven't been able to find much written on how to do PNGs in PHP.
Thanks in advance.

I have a Java program that does this, but my hosting company recently upgraded their PHP version and now any java call (even a HelloWorld program) through the php system function returns an "unable to reserve enough memory for the VM" error. My attempts at a workaround in order to call the Java program some other way have been unsuccessful (even though I have no problem calling it through SSH--they don't have the ssh module installed for php, or I'd try it that way.)
So, I need to figure out how to write this in PHP. I didn't do it in PHP in the first place because my readings through the image functions led me to believe that I couldn't get the desired effect. All I need to do is this:
Draw antialiased lines on a transparent image, and have the antialiasing affect the alpha layer.
Can someone please provide me with some sample code or direction on how to do this? I've searched extensively and haven't been able to find much written on how to do PNGs in PHP.
Thanks in advance.