|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-09 17:24 UTC] pajoye@php.net
[2003-03-01 09:51 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
(Not sure whether this should be here or under GD related) It would be useful if PHP had access to the gdSaveAlpha function in the GD library. Using PHP 4.3.0 with bundled GD, there is currently no way I can see to prevent imagepng stripping the alpha channel of a truecolor image. The following script produces a white circle on a black background, rather than a semi-transparent circular 'hole': <?php $image = imagecreatetruecolor(200, 200); imagealphablending($image, false); imagefilledellipse($image, 100, 100, 150, 150, 0x3fffffff); header('Content-type: image/png'); imagepng($image); ?> According to the GD change list at http://www.boutell.com/gd/manual2.0.9.html#whatsnew2.0.2 this is the correct default behaviour since version 2.0.2 - there is a function gdSaveAlpha to turn on and off alpha output which appears to be present in the bundled GD in CVS but at the moment without any PHP wrapper. A PHP function imagesavealpha(resource image, bool savealpha) would allow alpha output when required without breaking any existing scripts. -S. Haydon