#45030 [Opn->Fbk]: Destination image alpah channle noise when using imagecopyresampled
| From: | pajoye@php.net | Date: | Sun, 18 May 2008 10:29:15 +0000 |
| Subject: | #45030 [Opn->Fbk]: Destination image alpah channle noise when using imagecopyresampled | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125091@lists.php.net to get a copy of this message | ||
ID: 45030
Updated by: pajoye@php.net
Reported By: lieyang at yahoo dot com
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: x86_64 GNU/Linux Kernel 2.6.9-4
PHP Version: 5.2.6
Assigned To: pajoye
New Comment:
The 56x56 image looks perfectly fine to me. I also checked the alpha
values for the translucent areas and they look fine too (full
translucent when they are not near the star anti aliased pixels, as
expected).
To see how is the alpha channel in the result image, please look at
this zoomed version of the alpha channel only:
http://pierre.libgd.org/bugs/45030_alpha_only.png
100% black means opaque and the gray squares are only to show a
background (what would be behind the image). As you can see, there is no
noise in the transparent areas.
Are you sure that there is not a bug in the Motorola display system?
Maybe it does not support semi transparent pixels.
Previous Comments:
------------------------------------------------------------------------
[2008-05-18 03:51:39] lieyang at yahoo dot com
Here are my test source image (png 90x90): http://tinyurl.com/65tdtm
Resized to 56x56 with noise in alpha channel: http://tinyurl.com/6yold7
------------------------------------------------------------------------
[2008-05-18 03:41:50] lieyang at yahoo dot com
Please try the following with different image sizes and you will see
that the alpha channel has noise.
(I have two original before and after images but can not find the link
to upload them as attachments)
$imageSrc = imagecreatetruecolor(90, 90);
imagealphablending($imageSrc, false);
imagesavealpha($imageSrc, true);
$color = imagecolorallocatealpha($imageSrc, 0, 0, 0, 127);
imagefill($imageSrc, 0, 0, $color);
$imageDst = imagecreatetruecolor(56, 56);
imagealphablending($imageDst, false);
imagesavealpha($imageDst, true);
imagecopyresampled($imageDst,$imageSrc, 0, 0, 0, 0, 56, 56, 90, 90);
header('Content-type: image/png');
imagepng($imageDst);
------------------------------------------------------------------------
[2008-05-17 23:11:41] rasmus@php.net
We need a better reproducible example here, including the source image.
When the source image has a perfect alpha channel, I see no noise. Try
this:
$imageSrc = imagecreatetruecolor(500, 500);
imagealphablending($imageSrc, false);
imagesavealpha($imageSrc, true);
$color = imagecolorallocatealpha($imageSrc, 0, 0, 0, 127);
imagefill($imageSrc, 0, 0, $color);
$imageDst = imagecreatetruecolor(50, 50);
imagealphablending($imageDst, false);
imagesavealpha($imageDst, true);
imagecopyresampled($imageDst,$imageSrc, 0, 0, 0, 0, 50, 50, 500, 500);
header('Content-type: image/png');
imagepng($imageDst);
------------------------------------------------------------------------
[2008-05-17 22:52:00] pajoye@php.net
In fact yes, I need the source image (what you have in $imageData).
Sorry for the double posts.
------------------------------------------------------------------------
[2008-05-17 22:48:55] pajoye@php.net
no need for src images :-)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/45030
--
Edit this bug report at http://bugs.php.net/?id=45030&edit=1