private function expandImage($color, $borderWidth, $borderHeight, Image $image)
{
$imageWidth = $image->getWidth();
$imageHeight = $image->getHeight();
$original = clone $this->imagick;
// Clear the original and make the canvas
$this->imagick->clear();
$this->imagick->newImage($imageWidth + $borderWidth * 2, $imageHeight + $borderHeight * 2, $color);
$this->imagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_OPAQUE);
$this->imagick->setImageFormat($image->getExtension());
$this->imagick->compositeImage($original, Imagick::COMPOSITE_COPY, $borderWidth, $borderHeight);
}