|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-24 18:14 UTC] derick@php.net
[2004-02-24 18:30 UTC] nih at phlux dot co dot uk
[2004-03-15 08:09 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 09:00:01 2025 UTC |
Description: ------------ The elliptical drawing tools in the GD library that offer a fill function do not correctly render the fill when using a translucent colour. It would appear that the fill is drawn by a series of lines from the centre point to each pixel around the edge of the ellipse or arc, thus pixels near the centre are drawn over many times, thus increasing the effective alpha of those pixels. Reproduce code: --------------- <?php $img = imagecreatetruecolor(100, 100); imageantialias($img, FALSE); $blue = imagecolorallocatealpha($img, 0, 0, 255, 50); imagefilledarc($img, 5, 5, 170, 170, 0, 85, $blue, 4); header("Content-type: image/png"); imagepng($img); imagedestroy($img); ?> Expected result: ---------------- There should be a PNG image output of an arc of a 170px diameter going from a bearing of 090 to a bearing of 175 in 50% transparent pure RGB blue (0, 0, 255). Actual result: -------------- The transparency isn't correct, the closer towards the centre of the arc the pixel is, the lower it's transparency (I'm almost certain it's because they are being redrawn over and over).