HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Border image

← blurImage   brightnessContrastImage →
Surrounds the image with a border of the color defined by the bordercolor ImagickPixel object.

Example

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