Adds a simulated three-dimensional border around the image. The width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer bevels indicate the width of the inner and outer shadows of the frame.
function frameImage(
    $image_path,
    $color,
    $width,
    $height,
    $inner_bevel,
    $outer_bevel
) {
    $imagick = new \Imagick(realpath($image_path));

    $width = $width + $inner_bevel + $outer_bevel;
    $height = $height + $inner_bevel + $outer_bevel;

    $imagick->frameimage(
        $color,
        $width,
        $height,
        $inner_bevel,
        $outer_bevel
    );
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}