Resize an image with transparency
| From: | Victor Spång Arthursson | Date: | Mon, 28 Jun 2004 13:43:12 +0000 |
| Subject: | Resize an image with transparency | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-189159@lists.php.net to get a copy of this message | ||
Hi!
I'm having big GD-problems…
I want to open, resize and output a png-file with transparency.
Ad I have undestood it, the steps to follow is:
* open the image
* read the size
* create new image
* copy the image resized/resampled to the new image
* output the new image
But the problem that occurs is that the new image is not transparent, even though I specify
ImageAlphaBlending($img_des,true);
The only way I've succeeded to make the background transparent is to fill the image with a color and explicitly tell GD that that color (black for example) is transparent. But then all black pixels in the finished image, the one for output, become transparent as well, which is not what I want…
So, please, deadline before vacation, help if you know!
Sincerely
Victor Spång Arthursson / Denmark-Sweden