Results 1 to 2 of 2
Thread: Noise with ImageCopyResampled
Dec 1, 2011, 04:14 #1
- Join Date
- Oct 2010
- 0 Post(s)
- 0 Thread(s)
Noise with ImageCopyResampled
It is almost the holiday season and to my surprise it is unfortunately already snowing in my transparent images.
The situation is that I am uploading transparent PNG images with the given code below and the result is that there is noise in the final image.
Searching the web for answers tells me that more people had this but any solution is not to be found
only PHP.net shows me that in the past there where even some bug reports about it.
Switching from imagecopyresampled to imagecopyresized solves it but then the quality of the image is to cry for.
Can anyone tell me more about the problem, if you also encountered it and what you did to fix it?
$new_image= imagecreatetruecolor($new_width, $new_height);
$transparent= imagecolorallocatealpha($new_image, 255, 255, 255, 127);
imagefilledrectangle($new_image, 0, 0, $new_width, $new_height, $transparent);
imagecopyresampled($new_image, $original_file, 0, 0, 0, 0, $new_width, $new_height, $orig_width, $orig_height);
Dec 1, 2011, 05:49 #2
- Join Date
- Dec 2005
- Cambridge, England
- 55 Post(s)
- 2 Thread(s)