HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Chop image

← charcoalImage   claheImage →
Removes a region of an image and collapses the image to occupy the removed portion.

Example

function chopImage($image_path, $startX, $startY, $width, $height)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->chopImage($width, $height, $startX, $startY);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}