btw, I am doing the exact same thing on bitcoininflationindex.com. I use netlify for my frontend and use their "On-demand builders" to generate images which are cached on the edge.
Works perfect for this use-case. You could spin up a netlify microservice specifically for this purpose and run it separate from the site.
That’s an option I’m thinking about. I don’t use netlify but I could do something like this with AWS lambda.
reply