Automattic created node-canvas a long time ago which was based around Cairo.
We got acqui-hired in 2015 and the product was shut down, but in hindsight I wish we'd open sourced at least those libraries.
Looks like it would have been a lot easier if this existed back then. (haven't worked on the site for 5+ years)