Search code examples
svgimagemagickimage-manipulation

ImageMagick converts svg file to xbm with artifacts and changed size


Trying to convert some icons from svg to xbm to display them with NodeMCU on OLED display.

Using this command: mogrify -path ../src -format xbm *.svg

As You can see below output is a bit unexpected. Also it changes width and height, so from 16x16 svg it produces 15x15 xbm.

How to preserve original size and get rid of this artifacts?

  • Inkscape 0.92.4
  • ImageMagick 6.9.7-4 Q16 x86_64 20170114
  • elementary os 5.0 (Ubuntu 18.04.2 LTS)

enter image description here


Solution

  • Using Imagemagick 6.9.10.77 Q16 Mac OSX Sierra with SVG renderer Inkscape 0.92.4, I get:

    convert Unknown.svg Unknown.xbm
    


    Here is the result expanded for viewing and showing a size of 16x16 pixels.

    enter image description here

    I suspect that if you upgrade your version of Imagemagick so that it properly uses Inkscape, that it might work correctly to convert your SVG file.