Creating Transparent PNG Images in GD

13:07.51 - Tuesday 27th March 2007   (Link to This Entry)


For a project at work I had to create a true colour PNG from scratch using GD, copy a load of image files to it from various locations and then display it on-screen.

The code to create a transparent PNG turned out to be a litle complicated: Important Note: If you output the image direct into the document stream as this example does, the PNG fix that uses bahaviours won't work as it's not a true PNG. For that, you'll have to drop the header and give imagepng() a filename and show that file. Seems to work fine in other browsers, however.


[ 3 comments pending ]