问题
I have tried to convert SVG to PNG image but it's not working, Tested using this link, but it's creating the white image and if I used
$image->setBackgroundColor(new ImagickPixel('transparent'));
it created the black/transparent image
SVG image : SVG image actual view on browser After converting: SVG to PNG
SVG with mask : Sample
回答1:
Given all your data downloaded to my computer, I can convert it to png using ImageMagick 6.9.10.82 Q16 Mac OSX Sierra that calls Inkscape 0.92.4 as the SVG renderer.
convert right.inside.svg x.png
You have not shown the correct result. So I do not know if this is correct or not. But it does appear to be correct given the images in the assets folder.
However, the mask and other image needs to be accessible from whomever is trying to view the svg file. So either the data needs to be downloaded or perhaps you need to provide the URL to those files on some server that has the svg file.
来源:https://stackoverflow.com/questions/59100921/imagemagick-not-working-to-convert-the-svg-svg-having-mask-image-also-to-png