How to convert a SVG to a PNG with ImageMagick?

前端 未结 18 2078
一个人的身影
一个人的身影 2020-11-28 17:04

I have a SVG file that has a defined size of 16x16. When I use ImageMagick\'s convert program to convert it into a PNG, then I get a 16x16 pixel PNG which is way too small:<

18条回答
  •  萌比男神i
    2020-11-28 17:49

    In order to rescale the image, the option -density should be used. As far as I know the standard density is 72 and maps the size 1:1. If you want the output png to be twice as big as the original svg, set the density to 72*2=144:

    convert -density 144 source.svg target.png
    

提交回复
热议问题