diff --git a/src/Drivers/Imagick/Encoders/WebpEncoder.php b/src/Drivers/Imagick/Encoders/WebpEncoder.php index 552b23ab..93a26fd9 100644 --- a/src/Drivers/Imagick/Encoders/WebpEncoder.php +++ b/src/Drivers/Imagick/Encoders/WebpEncoder.php @@ -21,7 +21,10 @@ class WebpEncoder extends GenericWebpEncoder implements SpecializedInterface $imagick = $image->core()->native(); $imagick->setImageBackgroundColor(new ImagickPixel('transparent')); - $imagick = $imagick->mergeImageLayers(Imagick::LAYERMETHOD_MERGE); + if (!$image->isAnimated()) { + $imagick = $imagick->mergeImageLayers(Imagick::LAYERMETHOD_MERGE); + } + $imagick->setFormat($format); $imagick->setImageFormat($format); $imagick->setCompression($compression);