Puneet
Puneet

Reputation: 5

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

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

Upvotes: 0

Views: 969

Answers (1)

fmw42
fmw42

Reputation: 53164

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


enter image description here

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.

Upvotes: 0

Related Questions