public function frame($width, $height)
{
$this->preModify();
$this->contain($width, $height);
$x = ($width - $this->getWidth()) / 2;
$y = ($height - $this->getHeight()) / 2;
$newImage = $this->createImage($width, $height);
$newImage->compositeImage($this->resource, \Imagick::COMPOSITE_DEFAULT, $x, $y);
$this->resource = $newImage;
$this->setWidth($width);
$this->setHeight($height);
$this->postModify();
$this->setIsAlphaPossible(true);
return $this;
}