svg to jpg
function svgToJpg($svgFile) { $svg = file_get_contents($svgFile); $png = new Imagick(); $png->setBackgroundColor(new ImagickPixel('transparent')); $png->setFormat("jpeg"); $png->readImageBlob($svg); $png->setImageFormat("jpeg"); $png->writeImage('test.jpg'); $png->clear(); $png->destroy(); }