HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Imagick::scaleImage

← sampleImage   segmentImage →
Scales the size of an image to the given dimensions. The other parameter will be calculated if 0 is passed as either param.

Example

function scaleImage($image_path, $scale_width, $scale_height)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->scaleImage($scale_width, $scale_height, false);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}