There are a large number of SVG images. It is necessary to convert them to PNG or JPEG. What is better to use?

    3 answers 3

    Imagemagick, inkscape: both can convert images from the command line

      Use the wonderful Inkscape package, which has image import / export options. To date, this is the best render you can find. Just run inkscape --help and immerse yourself in the world of amazing opportunities that this wonderful program gives.

      Of course, there is another option: you install Chrome and on HTML5, using the Canvas tag, draw all the images. There is absolutely no need to install software, you can use site visitors as a distributed botnet for computing and rendering, which in the world of winning HTML5 is an excellent practice and is available to everyone!

        Better to use PNG. JPEG is for photos only. Something like this:

         for f in *.svg ; do convert -background transparent -density 1000 "$f" "${f%svg}png" ; done 

        Details about all the parameters are written here: https://www.imagemagick.org/script/convert.php

        But in general, SVG is a format that is best used as is. You can lose a lot both in quality and in volume when converting a vector into a raster.