#30243 [Opn->Bgs]: ...topalette creates 2 colors from 1 color image

From: Date: Sun, 26 Sep 2004 12:38:43 +0000
Subject: #30243 [Opn->Bgs]: ...topalette creates 2 colors from 1 color image
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66714@lists.php.net to get a copy of this message
ID: 30243 Updated by: johannes@php.net Reported By: pmpp at sapo dot pt -Status: Open +Status: Bogus Bug Type: *Graphics related Operating System: Windows XP PHP Version: 4.3.9RC3 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. See #30242 Previous Comments: ------------------------------------------------------------------------ [2004-09-26 13:37:22] pmpp at sapo dot pt Description: ------------ I create a truecolor image, fill it with 1 color, then I make that color transparent, but when I convert the image to palette, I get 1 pixel of a slightest different color of the first one, shifted 1pixel to the right of every pixel near a transparent pixel. [GD Version] => bundled (2.0.28 compatible) Reproduce code: --------------- <?php $image = imagecreatetruecolor(100,100) or die(""); $color = imagecolorallocate($image, 255, 229, 178); imagefill($image, 0, 0, $color); imagecolortransparent( $image, $color); imagetruecolortopalette ( $image, 0, 255); imagepng($image); ?> Expected result: ---------------- I expect to have all the image transparent. Actual result: -------------- With a more complex image, it's as I had moved a selection of the NON transparent image, full of a slightest different color of the one I made transparent, moved 1pixel to the right in the background. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30243&edit=1

« previous php.bugs (#66714) next »