X and Twitter Card Images
Render X (Twitter) summary_large_image cards at 1200x675 and Open Graph cards at 1200x630 from one HTML template with Open Assets, and wire them into Next.js.
An X (Twitter) large summary card image is usually rendered at 1200x675 (16:9), while the Open Graph image other networks read is 1200x630 (1.91:1). Open Assets renders both from one HTML template: the "OG Image / Social" preset already exports 1200x630 and 1200x675.
Card sizes
| Label | Suggested name | Width | Height |
|---|---|---|---|
| OG image | og | 1200 | 630 |
| X / Twitter card | twitter-card | 1200 | 675 |
Last verified: 2026-11-17.
X's developer card pages were not reachable on 2026-11-17 (the request returned HTTP 402), so check the current summary_large_image rules there before relying on exact limits. 1200x675 is the size Open Assets uses for X.
Command and config
npx open-assets add collection # pick "OG Image / Social (1200x630, HTML)"
npx open-assets render --collection og-image{
"id": "og-image",
"label": "OG Image",
"sourceSize": { "width": 1200, "height": 630 },
"templates": [{ "src": "src/og-image.html", "name": "og-image" }],
"export": [
{ "name": "1200x630", "label": "OG Image", "size": { "width": 1200, "height": 630 }, "outFile": "../web/public/og.png" },
{ "name": "1200x675", "label": "Twitter Card", "size": { "width": 1200, "height": 675 }, "outFile": "../web/public/og-x.png" }
]
}Example output

Steps
- Add the preset, or paste the config above.
- Design at 1200x630 and leave about 90px of empty space on the right, because the 1200x675 render scales up 1.07x and crops the right edge.
- Render with
npx open-assets render --collection og-image. - Point your page metadata at the files (below).
export const metadata = {
openGraph: { images: [{ url: "/og.png", width: 1200, height: 630 }] },
twitter: { card: "summary_large_image", images: ["/og-x.png"] },
};Gotchas
- One source, two ratios. If the crop hurts your layout, add a second collection with a
1200x675source for X. - Paint a background. Transparent PNG areas show in unpredictable colors.
- Cache. X and other networks cache card images; a new file name forces a refresh.
FAQ
Open Assets renders X cards at 1200x675 (16:9). Many sites send the 1200x630 Open Graph image and let X crop it; a dedicated 16:9 file avoids the crop.
No, twitter:image falls back to og:image. A separate 1200x675 file just fits X's 16:9 preview better.
Yes, one template per page, or generate the HTML files with a script and list them. See OG images.
Either. A .jpg outFile gives a smaller file; PNG keeps text sharper.
Related
New to Open Assets?
See examples from shipped apps and install it in one command on open-assets.dev.
Last updated on
OG Images and Social Cards
Design Open Graph and X card images as HTML templates, render them at 1200x630 and 1200x675, and write each one straight into your web app's public folder.
Favicons and PWA Icons
Generate favicon, apple-touch-icon and PWA manifest icons from one HTML or SVG template, written into public/ with outFile. Covers PNG only output and .ico.