質問

i am creating a thumbnail from my pictures but the result have a low quality! and colors are mixed. what can i do for this?

part of my code:

$thumb = imagecreatetruecolor($newWidth,$newHeight);
$source = imagecreatefromjpeg($srcImage);
imagecopyresized($thumb,$source,0,0,0,0,$newWidth,$newHeight,$width,$height);
imagejpeg($thumb,$desImage);
役に立ちましたか?

解決

Replace imagecopyresized with imagecopyresampled to make the resizing better.

Then you can change the third argument to imagejpeg to change the quality of the save. The default is 75 and max is 100.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top