Open qo4on opened 1 year ago
Yes, though pycairo is a thing that outputs svgs rather than inputs them. You need a higher level library that can load the SVGs (that may be a library that renders using cairo).
What did you try ?
OT: The SVG itself is quite pleasing / mesmerising to look at.
I tried this
import rsvg
width = 200
height = 200
svg = rsvg.Handle('anim.svg')
unscaled_width = svg.props.width
unscaled_height = svg.props.height
svg_surface = cairo.SVGSurface(None, width, height)
svg_context = cairo.Context(svg_surface)
svg_context.save()
svg_context.scale(width/unscaled_width, height/unscaled_height)
svg.render_cairo(svg_context)
svg_context.restore()
svg_surface.write_to_png('cool.png')
I didn't manage to convert this animated svg into a png sequence. Is it possible