PHP图片转为webp格式

把图片1.jpg转成1.webp,1.jpg是图片的真实地址

$img = new Imagick("1.jpg");

$img->setImageFormat("webp");

$img->writeImage("1.webp");

原文地址:https://www.cnblogs.com/ding-daisy/p/10442525.html