public function rotate(&$image, $angle, $color = null)
{
if ($image->isAnimated()) {
// Ignore animated GIF for now
return $this;
}
$color = $color !== null ? $color : new Color('#000000');
list($r, $g, $b, $alpha) = $color->getRgba();
$image->getCore()->rotateImage(new \ImagickPixel("rgba({$r}, {$g}, {$b}, {$alpha})"), $angle * -1);
return $this;
}