Skip to content

Automatic OG Generator

Composite live webpage snapshots with branded overlay for social preview images.

experimentalmediaNext.jsTypeScriptPuppeteerTailwind

Features


Automatic OG Generator produces consistent, high-quality Open Graph style images by screenshotting a target URL inside a controlled overlay frame. Titles and supporting subtitles are rendered beside (or above on narrow widths) the live or static snapshot.

Capture Flow

  1. Request /api/capture?url=... with width/height and optional overlay=1.
  2. Service navigates headless Chromium (Puppeteer) to the target, applies delay if specified.
  3. If overlay=1, it loads the /overlay route embedding the target site via iframe and captures the composed result.
  4. PNG is streamed back.

Core Parameters (Overlay Route)

Example

/overlay?url=https://example.com&title=Launch+Preview&subtitle=Fast+iteration+ahead&accent=%236366f1,%238b5cf6&autosize=1&theme=dark

Auto-Fit Title

A tiny client component measures and shrinks the title font size via binary search so long strings wrap into at most three lines while preserving maximum legibility.

Iframe Scaling

The snapshot iframe renders at a fixed internal base width (390px) then scales up proportionally with CSS transforms to fill the available mask, ensuring predictable typography proportions across varying output widths.

Roadmap Ideas

Why It Exists

Manually curating OG images slows iteration. This tool lets you generate on-brand visual previews from real pages (or static renders) with negligible manual design overhead.