python - how to overlay svg vector graphic over backgroud raster -
does knows how overlay svg vector graphic on backgroud raster (png) ?
preferably in python. i've tried cairo , rsvg i'm getting black bacground after converting svg png.
img = cairo.imagesurface(cairo.format_rgb24, width, height) ctx = cairo.context(img) print 'svg', tmp_svg handler = rsvg.handle(none, str(svg_data)) handler.render_cairo(ctx) img.write_to_png('/tmp/test.png')
after converting svg png overlay 2 png files python pil
image.blend(background, overlay, 0.5 )
maybe there simple solution overlaying directly background svg (without svg png)?
greets.
is image determined @ runtime, or beforehand? if latter, add <image>
element svg points background image.
Comments
Post a Comment