把图片1.jpg转成1.webp,1.jpg是图片的真实地址
$img = new \Imagick("1.jpg");
$img->setImageFormat("webp");
$img->writeImage("1.webp");