Hi !
Some SVG creation helpers have been discussed in this thread.
For rendering, the svg lib and maybe vectorasset might help to output a bitmap - not sure it works on the commandline.
It might be simpler to output the svg and render it as a second step with an external program/process. I use inkscape like this :
Sys.command("inkscape", [
'input/path/name.svg',
"--export-png", 'output/path/name.png',
"--export-dpi", '96',
"--export-area-page",
"--export-background", "ffffff"
]);
Would be interested in you findings !