/** * {@inheritdoc} * * @return ImageInterface */ public function rotate($angle, ColorInterface $background = null) { $color = $background ? $background : $this->palette->color('fff'); try { $pixel = $this->getColor($color); $this->imagick->rotateimage($pixel, $angle); $pixel->clear(); $pixel->destroy(); } catch (\ImagickException $e) { throw new RuntimeException('Rotate operation failed', $e->getCode(), $e); } return $this; }