Sets the image resolution.
Sets the image resolution, which is a hint to printers of what size to print the image i.e. how many dots per inch it should be printed at. This function does not affect the pixel dimensions of the image, and so does not have a noticeable effect on the image on a computer, which does not use the DPI setting to render an image.
Image
Sets the image resolution.
Sets the image resolution, which is a hint to printers of what size to print the image i.e. how many dots per inch it should be printed at. This function does not affect the pixel dimensions of the image, and so does not have a noticeable effect on the image on a computer, which does not use the DPI setting to render an image.
Parameters
x_resolutionfloat
y_resolutionfloat
function setImageResolution($imagePath)
{
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->setImageResolution(50, 50);
    
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}