Domanda

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);
È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top