Image
Width
Height
Color
 
function borderImage($imagePath, $color, $width, $height)
{
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->borderImage($color, $width, $height);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}