bahearn Posted July 31, 2009 Share Posted July 31, 2009 So, I am uploading two images one being a jpeg which uploads fine and resizes fine and another being a gif,png, or jpg but using imagepng to output the file. When I use image png the quality of the image is horrible any tips? heres what the image looks like (it's the one in the middle not the blue background that loads in fine as imagejpg) heres my code list($width,$height)=getimagesize($uploadedfile); $newwidth=200; $newheight=200; $tmp=imagecreatetruecolor($newwidth,$newheight); $colorTransparent = imagecolortransparent($src); imagepalettecopy($src, $tmp); imagefill($tmp, 0, 0, $colorTransparent); imagecolortransparent($src, $colorTransparent); imagetruecolortopalette($tmp, true, 256); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = "images/". $_FILES['file']['name']; imagepng($tmp,$filename); Link to comment https://forums.phpfreaks.com/topic/168281-php-gd-imagepng-quality/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.