imageMagick not working, to convert the SVG (SVG having mask image also) to PNG

怎甘沉沦 提交于 2020-01-06 14:17:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!