What could be causing the poor image quality when using imagecopyresized in PHP?

The poor image quality when using imagecopyresized in PHP could be caused by the interpolation method used during the resizing process. To improve the image quality, you can set the interpolation method to IMG_BILINEAR_FIXED. This will result in a smoother and higher quality resized image.

// Load the original image
$source = imagecreatefromjpeg('original.jpg');

// Create a new image with the desired dimensions
$destination = imagecreatetruecolor(200, 200);

// Set the interpolation method to IMG_BILINEAR_FIXED
imagecopyresampled($destination, $source, 0, 0, 0, 0, 200, 200, imagesx($source), imagesy($source), IMG_BILINEAR_FIXED);

// Output the resized image
imagejpeg($destination, 'resized.jpg');

// Free up memory
imagedestroy($source);
imagedestroy($destination);