php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30242 ...topalette creates 2 colors from 1 color image
Submitted: 2004-09-26 13:15 UTC Modified: 2004-11-19 11:20 UTC
From: pmpp at sapo dot pt Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 4.3.9RC3 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pmpp at sapo dot pt
New email:
PHP Version: OS:

 

 [2004-09-26 13:15 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-19 11:20 UTC] pajoye@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in head. 5.0 commit over the weekend.

--Pierre
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 23 19:01:25 2021 UTC