Convert SVG to PNG in Python
How do I convert an svg to png , in Python? I am storing the svg in an instance of StringIO . Should I use the pyCairo library? How do I write that code? The answer is " pyrsvg " - a Python binding for librsvg . There is an Ubuntu python-rsvg package providing it. Searching Google for its name is poor because its source code seems to be contained inside the "gnome-python-desktop" Gnome project GIT repository. I made a minimalist "hello world" that renders SVG to a cairo surface and writes it to disk: import cairo import rsvg img = cairo.ImageSurface(cairo.FORMAT_ARGB32, 640,480) ctx = cairo