Generate og:images from text with the Canvas API
mastrojs.github.io·4h
Flag this post

Mauro Bieg on November 16, 2025

A few weeks ago, Scott Jehl posted about the pain of generating Open Graph images: those images you link to with an og:image meta tag from your HTML, which are then displayed on social media or messenger apps when somebody shares a link to that page. (Side-note: a single <meta property="og:image" tag, together with the standard <title> and <meta name="description", is kind of enough.)

Most tools that generate those preview PNGs download and launch a full-blown web browser to take a screenshot of some HTML and CSS that you wrote. While that works, I’ve had something lighter in mind. All I wanted, was to render the title of the page on a nice-lookin…

Similar Posts

Loading similar posts...