Scripting figure creation with inkscape and python

Posted on Sat 06 November 2021 in posts

I spent some time figuring out how to use inkscape and python to script the creation of figures that contain bitmaps, allowing for the user to specify the DPI when embedded. Normally, the way to handle this involves creating the figures directly in a vector graphics editor like inkscape or Adobe Illustrator, which works fine, but I like to script as much as of my workflow as possible, to make testing different figure versions as quick as possible. I spent probably too much time getting it to work, but here's an example GitHub repo I made showing how the process works, with some tips on how to use it yourself.