svg base64 to jpg
function svg2png($string, $filename) { $encoded = base64_encode($string); $data = "data:image/svg+xml;base64,$encoded"; $image = new Imagick(); $image->readImageBlob($data); $image->setImageFormat("png24"); $image->writeImage("$filename"); }