You can read the SVG input using librsvg and then pass it using cairo . If you want to draw annotations in SVG from the original image, you may need to use PIL with numpy , since cairo itself does not load many different image formats.
Below is an example that achieves this (the only difference is that I actually tested it with an ad-hoc ctypes wrapper for rsvg ):
import sys import rsvg import cairo import numpy from PIL import Image
source share