HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Imagick::spliceImage

← sparseColorImage   spreadImage →
Splices a solid color into the image.

Example

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