resizeImage(500, 300, Imagick::FILTER_LANCZOS, 1); // Save resized image $image->writeImage('resized_image.jpg'); ?>
resizeImage($image->getImageWidth() * 0.5, $image->getImageHeight() * 0.5, Imagick::FILTER_LANCZOS, 1); // Save resized image $image->writeImage('resized_image.jpg'); ?>In this example, the image "image.jpg" is loaded and then resized to 50% of its original size using the resizeImage method. The width and height are determined by multiplying the original width and height by 0.5.