Approaches for dynamically creating opengraph images

Take a look at the theme for the Hugo docs site, specifically:

https://github.com/gohugoio/gohugoioTheme/blob/master/layouts/partials/opengraph/get-featured-image.html

It starts with an empty image, then overlays the desired text.