I make a preview for SVG in JPG format in nodejs using ImageMagick. Some files ( example ) are converted to empty rectangles. The problem is in ImageMagick itself - I run it in the console, the result is the same I guess the whole thing in the size of the SVG. Can this be solved with some ImageMagick parameters? What is the alternative?

  • Why do you convert vector graphics into raster? The jpeg format is for photos only ! - Beast Winterwolf
  • @BeastWinterwolf, and in what format do previews for SVG, if quality is not important, and size is critical? - Kain
  • better then png. It is not a vector though, but compression will be better in it and there will be less losses when changing the format, precisely because it was initially optimized to store images consisting of clear segments created on a computer, like svg. Jpeg, on the contrary, better compresses photorealistic images with smooth transitions, by adding noise to them, which is imperceptible in such images. - Beast Winterwolf

1 answer 1

Found alternatives: convert-svg-to-jpeg and svg2img . I had to tinker with the installation, svg2img did not want to convert to jpg without fraud with the new version of canvas.