Grafika\Imagick\Editor::flatten PHP Method

flatten() public method

Flatten if animated GIF. Do nothing otherwise.
public flatten ( Image &$image ) : self
$image Image
return self
    public function flatten(&$image)
    {
        if ($image->isAnimated()) {
            $imagick = $image->getCore()->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
            $image = new Image($imagick, $image->getImageFile(), $image->getWidth(), $image->getHeight(), $image->getType(), '', false);
        }
        return $this;
    }