How to convert a SVG to a PNG with ImageMagick?

前端 未结 18 2045
一个人的身影
一个人的身影 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条回答
  •  抹茶落季
    2020-11-28 17:40

    After following the steps in Jose Alban's answer, I was able to get ImageMagick to work just fine using the following command:

    convert -density 1536 -background none -resize 100x100 input.svg output-100.png
    

    The number 1536 comes from a ballpark estimate of density, see this answer for more information.

提交回复
热议问题