Are there any specific PHP classes or functions that can achieve the effect of CSS border-radius on an image?

To achieve the effect of CSS border-radius on an image using PHP, you can use the GD library to manipulate images. Specifically, you can create a new image with rounded corners by overlaying the original image on top of a rounded rectangle. This can be achieved by using functions like imagecreatefromjpeg, imagecopyresampled, and imagefilledellipse in PHP.

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

// Create a blank image with rounded corners
$roundedImage = imagecreatetruecolor($width, $height);
$bgColor = imagecolorallocate($roundedImage, 255, 255, 255);
imagefill($roundedImage, 0, 0, $bgColor);

// Create a rounded rectangle
$radius = 20;
imagefilledellipse($roundedImage, $radius, $radius, $radius * 2, $radius * 2, $bgColor);

// Overlay the original image on top of the rounded rectangle
imagecopyresampled($roundedImage, $originalImage, 0, 0, 0, 0, $width, $height, $width, $height);

// Output the rounded image
header('Content-Type: image/jpeg');
imagejpeg($roundedImage);

// Free up memory
imagedestroy($originalImage);
imagedestroy($roundedImage);