2
votes

I'm working on a script for which I need to do the following:

User uploads an image (JPG, PNG, GIF). PHP resizes it, increases the canvas size, and saves the images as a PNG file on the server.

Now I found this tutorial to learn how to do that: http://www.webxpert.ro/andrei/2009/01/08/thumbnail-generation-with-php-tutorial/

However, this will create a PNG file with a white background. Is it possible to have PHP generate it with a transparent background?

Thanks!

1
Where is the script you are working on - Baba

1 Answers

1
votes

The tutorial breaks it down into basic steps. Just find the step that puts a background colour in there, and put a transparent colour instead. You will need imagecolorallocatealpha and an alpha value of 127.