Useful Snippets


This blog is used to collect useful snippets related to Linux, PHP, MySQL and more. Feel free to post comments with improvements or questions!

Are your smart devices spying on you? Make better purchasing choices and find products that respect your privacy at

RSS Latest posts from my personal blog

Most viewed posts

Subscribe to RSS feed

SVG to PNG conversion with transparent background in ImageMagick

Stanislav KhromovStanislav Khromov

Here’s a quick way to convert SVG to PNG with transparent background

convert -background none image.svg image.png

Adjust size

If you want to scale the image to a larger size without antialiasing (which makes the image look fuzzy), you can add the density parameter, like this:

convert -density 200 -background none image.svg image.png

Simply increase the density value to increase the image size.

To install ImageMagick on OS X with Homebrew:

brew install imagemagick

For Ubuntu:

sudo apt-get install imagemagick

Web Developer at Aftonbladet (Schibsted Media Group)
Any opinions on this blog are my own and do not reflect the views of my employer.
Twitter Profile
Visit my other blog

Comments 1
  • Tim
    Posted on

    Tim Tim

    Reply Author

    In Mint 17.2 (and probably others), the librsvg2-bin package is also required.