๐—™๐—ฟ๐—ฒ๐—ฒ ๐—ข๐—š ๐—œ๐—บ๐—ฎ๐—ด๐—ฒ๐˜€ ๐—ช๐—ถ๐˜๐—ต ๐—ฃ๐—น๐—ฎ๐˜†๐˜„๐—ฟ๐—ถ๐—ด๐—ต๐˜

You need OG images for your articles. You do not want a monthly bill.

Use Playwright to screenshot HTML templates. It costs zero dollars. You get full CSS control. You need no API keys.

The trade-offs:

Why this beats other options:

The trick is the networkidle setting. This tells the browser to wait for fonts to load. Without it, images look wrong.

My setup:

The process is simple. The script makes the image. It saves the file to the repo. The site deploys to Cloudflare Pages.

For static sites, this is the best way. You control the design. You pay nothing.

Source: https://dev.to/morinaga/what-i-learned-generating-og-images-for-articles-with-playwright-and-zero-api-cost-18n8