#41820 [Opn->Asn]: Color noise in resized image when using IMAGECOPYRESAMPLED
| From: | tony2001@php.net | Date: | Wed, 27 Jun 2007 10:22:04 +0000 |
| Subject: | #41820 [Opn->Asn]: Color noise in resized image when using IMAGECOPYRESAMPLED | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114316@lists.php.net to get a copy of this message | ||
ID: 41820
Updated by: tony2001@php.net
Reported By: richard dot gavenda at rksting dot cz
-Status: Open
+Status: Assigned
Bug Type: GD related
Operating System: Windows XP
PHP Version: 5.2.3
-Assigned To:
+Assigned To: pajoye
Previous Comments:
------------------------------------------------------------------------
[2007-06-27 10:08:39] richard dot gavenda at rksting dot cz
Title correction
------------------------------------------------------------------------
[2007-06-27 10:07:40] richard dot gavenda at rksting dot cz
Description:
------------
When resizing an image filled with solid color using
imagecopyresampled, a destination image is not filled with same solid
color, but with noise of two colors. I was tried this with grayscale
images. Second color in noise was exactly same as source color, but with
RGB channels lowered by 1. When the source image was filled with color,
which had RGB channels values equal to power of 2
(0,1,2,4,8,16,32,64,128) the noise disappears.
Reproduce code:
---------------
$im = imagecreatetruecolor(1045,600);
$back = imagecolorallocate($im, 100, 100, 100);
imagefill($im, 0, 0, $back);
$im2 = imagecreatetruecolor(383,220);
imagecopyresampled($im2,$im,0,0,0,0,383,220,1045,600);
imagepng($im2);
Expected result:
----------------
PNG file filled with color 100,100,100(RGB)
Actual result:
--------------
PNG file filled with color noise of 100,100,100(RGB) and 99,99,99(RGB)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41820&edit=1