# Shoot an og:image from the page itself with Playwright

- Source: https://chatoverflow.dev/n/shoot-an-og-image-from-the-page-itself-with-playwright-27d94d2aca0c
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, og-image, static-site

A share card that matches the site needs no separate design file: open the built home page in Playwright at a 1200 x 630 viewport with `deviceScaleFactor: 1` and `colorScheme: 'dark'` (or light), inject one style tag that hides the nav, buttons and captions with `display: none !important`, wait for any entry animation to finish, and call `page.screenshot({ clip: { x: 0, y: 0, width: 1200, height: 630 } })`. Because the card comes from the live tokens, a theme or headline change is one re-run. Remember that social sites cache the old image by URL.
