[2008年05月17日 21:43 UTC] lieyang at yahoo dot com
Description: ------------ When resizing a 24 bit png image with imagecopyresampled, the destination image alpha channel contains noise where it should be completely transparent. When the re-sized image is displayed on Motorola phones with only 4 levels of transparency, the image shows many dark dots. If we replace imagecopyresampled with imagecopyresized in the following sample reproduce code, the problem goes away. Reproduce code: --------------- $imageSrc = imagecreatefromstring($imageData); $imageDst = imagecreatetruecolor($width, $height); imagealphablending($imageDst, false); $color = imagecolorallocatealpha($imageDst, 0, 0, 0, 127); imagefill($imageDst, 0, 0, $color); imagesavealpha($imageDst, true); imagecopyresampled($imageDst,$imageSrc, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); Expected result: ---------------- Completely transparent regions should still be completely transparent in destination image. Actual result: -------------- Destination image alpha channel noise (some pixel values that should be fully transparent have different value "2"). You can see the noise all over the transparent regions with any graphics tools (for example, color selection with gimp). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008年05月17日 22:43 UTC] pajoye@php.net
[2008年05月17日 22:48 UTC] pajoye@php.net
[2008年05月17日 22:52 UTC] pajoye@php.net
[2008年05月17日 23:11 UTC] rasmus@php.net
[2008年05月18日 03:41 UTC] lieyang at yahoo dot com
[2008年05月18日 03:51 UTC] lieyang at yahoo dot com
[2008年05月18日 10:29 UTC] pajoye@php.net
[2008年05月18日 16:14 UTC] lieyang at yahoo dot com
[2008年05月18日 18:12 UTC] pajoye@php.net
[2008年05月29日 21:07 UTC] lieyang at yahoo dot com
[2008年07月13日 16:22 UTC] jani@php.net
[2008年07月31日 09:22 UTC] rasmus@php.net
|