10 June 2012

RSVG-Convert SVG image conversion tool

LibRSVG is probably one of well known svg library (other is Batik), the library use libcairo for pdf,ps and svg backend. This is a convenient static build of RSVG-Convert (part of librsvg 2.34.2) compiled with MinGW. I made this since originally the executable would dragged many dependencies.

The command line also used by ImageMagick through delegates although being deprecated (the rsvg wrapper), currently rsvg-convert.exe support png, ps, pdf and xml output but not jpg.

use "rsvg-convert --help" to see its command options, notice that the default output is stdout so be sure to specify file output.

Download: rsvg-convert-  (last update: 03-04-2015)
note: embedded images now displayed (broken in previous builds), now support jpg, gif, png, svg, webp, tiff, wmf, emf, ico, xbm. images mime type alias also added.

Updated build also available at main page (along with imagemagick and friends)


  1. Hello,
    i've got some warning using your tool :
    (rsvg-convert.exe:12340): Pango-WARNING **: error opening config file 'E:/msys/MSYS/local/rsvg/etc/pango\pangorc': Permission denied

    and some error about fonts :
    (rsvg-convert.exe:12340): Pango-WARNING **: couldn't load font "MS Shell Dlg Not-Rotated 2.439453125", falling back to "Sans Not-Rotated 2.439453125", expect ugly output.

    (rsvg-convert.exe:12340): Pango-WARNING **: couldn't load font "MS Shell Dlg Not-Rotated 2.7998046875", falling back to "Sans Not-Rotated 2.7998046875", expect ugly output.

    (rsvg-convert.exe:12340): Pango-WARNING **: couldn't load font "MS Shell Dlg Not-Rotated 2.9677734375", falling back to "Sans Not-Rotated 2.9677734375", expect ugly output.

    (rsvg-convert.exe:12340): Pango-WARNING **: couldn't load font "MS Shell Dlg Not-Rotated 2.8154296875", falling back to "Sans Not-Rotated 2.8154296875", expect ugly output.

    (rsvg-convert.exe:12340): Pango-WARNING **: couldn't load font "MS Shell Dlg Not-Rotated 2.8798828125", falling back to "Sans Not-Rotated 2.8798828125", expect ugly output.

    Anyway, your tool works well, thank you !

    1. the first error message are harmless it's not needed for windows, the warnings also generally can be ignored. But if you concerned (your text output not looking good). Try download this http://osspack32.googlecode.com/files/fontconfig.7z extract it to where you have rsvg and execute fc-cache (it will cache your whole windows's fonts), it may takes time to finished. Then try again rsvg

      note: I'm not sure whether my previous build has fontconfig support, so I updated it (version 2.36.1) as the same link in original post. try redownload

  2. Hello,
    your update remove the first error, thank you !
    For the others, the text output seems ok, so I keep the actual fonts, but in case of, I will apply your solution.

  3. Hi TumaGonx Zakkum,

    Thank you very much for this static build. I wish you could keep it up to date.

  4. Really useful, thanks! I'm having incompatibility issues between MediaWiki (librsvg) and Inkscape, and this allows me to test out my changes without needing to keep re-uploading duff images to MediaWiki.

    1. maybe you just need rsvg-viewer? http://osspack32.googlecode.com/files/rsvg-view-3.exe
      drag n drop svg on it or associate it with svg

    2. Interesting, thanks. Only snag is, the window doesn't open to the size of the document, and twice within the last few minutes I've crashed the program simply enlarging the size of the window using the size grip. (Windows 8 Pro)

      Certainly easier than repeatedly saving to PNG though :)

      (PS your OpenID system doesn't work. "Your OpenID credentials could not be verified. Makes no effort to actually check; it just can't be bothered, and gives up.)

    3. Have you downloaded the latest (same link)? the not open to size issue have been fixed AFAIK.

      About the openID, i'm not sure if I can do anything about it, I think it's part of blogspot? Sorry about it

    4. Ah yes, on some svgs there is 20-30px missing from the window. Can't confirm about windows 8 crash though

    5. Same crash in XP SP3 32-bit:


      Randomly crashes when enlarging the window, as you can see from the above. Might be image dependent. You can contact me via my website if you want me to try test builds etc.

    6. Maybe because I'm not enabling "Show windows contents while dragging" desktop setting. But still, this is a bug (for GTK-3)

    7. The crash in rsvg-view-3.exe is caused by the window being too narrow for the toolbar. (I've not triggered the crash in a long time, but I decided to see if I could work out what the cause is).

      If you resize the window smaller and smaller, it will crash at the instant that the window width is narrower than the total width of the toolbar buttons, i.e. when the Zoom Out button starts to disappear off the edge of the window.

      I think I was triggering it with very small SVG images at the time.

      (Note that I am now in Windows 8.1 Pro 64-bit, not XP.)

  5. Thanks. Very useful.

  6. thank you very much! long ago I was looking for svg to png converter, it is best to have a few kb

  7. Hi,

    I've downloaded the exe. When I'm running it, it opens the win cmd and do nothing.

    Any clue?

    1. 1. open the commandline "cmd"
      2. CD to the DIR of the EXE
      3. try something like this or what ever you wanted to do:

      rsvg-convert.exe -a -w 500 -f svg INPUT.SVG -o OUTPUT.SVG

  8. Hi,

    I tried to get the help as you have mentioned. But i get the following error

    D:\ImageMagick>rsvg-convert.exe -help
    Missing argument for -h

    1. notice the commandline use two dash "--help"

    2. Thanks for the quick reply.. works like a charm.

  9. Awesome tool..

    By the way, I can't convert an eps file using this right?
    when I tried, I am getting
    Error reading SVG:Error domain 1 code 4 on line 1 column 1 of file:///D://eps/Template2.eps: Document is empty

    It clearly says, Error reading SVG. :)

  10. Hi,

    Does this support embedding external images?

    I have an svg file with 'image' tag which was not rendered by this program. All I see in the output is text.

  11. Haven't tried that myself, maybe this help http://stackoverflow.com/questions/2961624/rsvg-doesnt-render-linked-images

  12. I've begun to use rsvg-convert for text-based SVG, and it's wonderful.

    However, my svg has an image embedded in it using the form of:

    height = "100"
    width = "100"
    x = "455"
    xlink:href = "data:;base64,{imageDataInBase64}"
    y = "90"

    My image is not getting into the PDF. Is rsvg-convert unable to process images?


  13. Hi,
    Your rasterizing utility is excellent.

    However, I have observed that applying various desired dpi densities in command-line parameters, like this:
    rsvg-convert.exe -d 300 -p 300
    rsvg-convert.exe -d 100 -p 100
    rsvg-convert.exe -d 600 -p 600
    or like this
    rsvg-convert.exe --dpi-x 600 --dpi-y 600
    or even without specifying density which should default to 90:


    Moreover, the effect is (what I'm verifying by examining obtained raster image geometry comparing with SVG contents) as in all cases, density of 300 dpi has been used.

    Obtained PNG files with various settings are binary identical.

    After some experiments, I've observed that the only method to control effective resolution, is to pass width and height parameters recalculated accordingly. For example, to obtain 600 dpi, it is necessary to pass width and height multiplied twice.

    In my application, I have to keep control over raster image geometry so as to have its content in sync with vectors displayed above, so proper behavior in this matter is for me important.

    May be there is something wrong in the way I pass density parameters?

    Could you explain this behavior, please?

    1. Hi Krzysztof,

      Just to clarify I'm not write this app, I just build unofficial win32 executable like all other stuff in this blog.

      I can't help you or confirm this bug at the moment but if you're sure about it, you can filled bugreport to the developer here https://bugzilla.gnome.org/browse.cgi?product=librsvg. They're the right person to talk about it :)

    2. Thank you for fast response.
      I've found following issue at bugzilla:

      There is no difference between different DPIs

      that seems to point to the same problem, but with no answer.
      I'll try to post my own one.


  14. This comment has been removed by the author.

  15. Thx for making this wonderful conversion tool. But I have 2 major issues. 1) When converting to PDF, the opacity value in the or elements are ignored. 2) The conversion fails to apply bold or italic styles for some font such as WenQuanYi Zen Hei (文泉驛正黑).

    1. Thanks, librsvg 2.40 released few days ago, will see if I can do something about the bug when updating the win32 binary.

    2. Sorry my previous comment was incomplete. For the PDF conversion, I mean the opacity property in "g" and "text" elements are ignored. This isn't the problem when converting to PNG.

      For the bold and italic font, your conversion tool reports that it can't find "WenQuanYi Zen Hei bold" or "WenQuanYi Zen Hei italic", but this problem doesn't exist in Wikimedia which uses the same typeface.

  16. Hi, thanks for this. I have the same problem with failure to open 'E:/msys/MSYS/local/rsvg/etc/pango\pangorc': etc but in my case, since E: is my optical drive, I get a while bunch of windows warning dialogs saying "there is no disk in the drive please insert a disk". Not usable in that case. Thanks.

  17. One bug about converting to PDF: it is unable to apply mask (http://www.w3.org/TR/SVG11/masking.html#Masking), but the mask is present while converting to PNG.

  18. I've just sketched a quick icon for the program, but having tried to use Resource Editor to attach my icon, I get:

    Application Error
    Failed to load resource module:.

    I assume that this is caused by the program having zero resources, since I can open Pidgin's EXE just fine, and that's a GTK program.

    I assume that just giving the program a VERSIONINFO resource would be enough to let me insert an icon into it.



    1. I use UPX on it. Try to decompress it first before using reshack.

    2. No change, though it shouldn't have any effect, bearing in mind that UPX cannot compress resources otherwise VERSIONINFO and icons wouldn't be readable by the shell!

    3. Try XN Resource Editor. I've test it, should be OK
      Why it need to decompressed first, is because UPX STILL alter the PE header although by default preserve first icon and etc if a resource editor don't understand the compression method (in this case the newer brute LZMA) it will output invalid PE.


    4. OK, that works, thanks. (Can't be bothered to screw around with the OpenID sign-in again.)

  19. As i see, this SVG convesion tool supports converting SVG to PNG, but just wonder whether it supports SVG to JPG now?

    Tags: image conversion tool, convert SVG image

    1. It doesn't. You need other converter such imagemagick, but it might be trivial to make it support jpg output via gdkpixbuf though.

  20. Cool tool. What a shame that the useful SVG format is not more popular yet! :-(