Useful Snippets

Welcome!


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 Unwanted.cloud

RSS Latest posts from my personal blog


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

Full-stack impostor syndrome sufferer & Software Engineer at Schibsted Media Group

Comments 1
  • Tim
    Posted on

    Tim Tim

    Reply Author

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