OG image generator: specs, meta tags and 3 ways to make them
What an OG image is, the sizes Meta and X ask for, the meta tags to copy, and three ways to generate one per page: a website, code, or an agent skill.
- For
- Developers and founders who want link previews for every page
- Written for
- Claude CodeCodexCursorGitHub CopilotGemini CLIOpenCodeAny agent that reads SKILL.md folders
- Time
- 9 min read · updated Nov 10, 2026
The short answer
- An OG (Open Graph) image is the picture a site shows when someone shares your link. You set it with an
og:imagemeta tag that points to an absolute URL. Make it 1200×630 pixels, as a PNG or JPG under 5 MB, and addtwitter:cardset tosummary_large_imageso X shows it large. - An OG image generator makes that picture for you. There are three kinds: a website where you type a title and download one image, code that draws an image per page at build time (such as Vercel’s
@vercel/og), or an agent skill that reads your posts, renders a card for each and wires up the tags. Lookbk’s Editorial OG Card is a free skill of the third kind.
When a link is shared in a social app or a chat, the app fetches the page and looks for Open Graph tags in its <head>. If it finds an image, the link becomes a card with that image on top. Without one you get a bare link or whatever picture the app guesses. One image per page, with that page’s title on it, is what makes shared links look intentional.
What an Open Graph image is
The Open Graph protocol (ogp.me) defines four required properties for every page: og:title, og:type, og:image and og:url. og:image is “an image URL which should represent your object within the graph”. It can carry structured properties of its own: og:image:width and og:image:height in pixels, og:image:type for the MIME type, og:image:secure_url for an HTTPS address, and og:image:alt, which ogp.me describes as “a description of what is in the image (not a caption)”.
X reads its own twitter: tags but falls back to Open Graph: its card docs list og:image as the fallback for twitter:image and og:title for twitter:title. So one set of OG tags plus twitter:card covers both.
OG image size and specs
Meta’s docs add one more reason to set og:image:width and og:image:height: they tell the crawler the dimensions, so it can render the image right away instead of downloading and measuring it first.
The meta tags to copy
In Next.js (App Router) you don’t write these by hand. Set metadataBase in the root layout so relative image paths become full URLs, then return openGraph.images and twitter: { card: 'summary_large_image' } from each page’s metadata. The Next.js docs note that a relative URL without metadataBase causes a build error.
Three ways to make OG images
Code at build time: @vercel/og, Satori and Next.js
Vercel’s @vercel/og library generates images in Vercel Functions: it “uses Satori and Resvg to convert HTML and CSS into PNG”, and its docs recommend 1200×630. Satori itself turns HTML and CSS into SVG and is licensed MPL-2.0. In Next.js the library is already included as ImageResponse from next/og, and an opengraph-image.tsx file in a route folder makes that route’s image; by default, the Next.js docs say, such images are generated at build time and cached.
Vercel’s docs list the limits to plan around: fonts in ttf, otf or woff, flexbox and a subset of CSS rather than every layout, and a 500 KB bundle including fonts and images. They also suggest allowing the image route in robots.txt, so the platforms’ crawlers can fetch it.
An agent skill
A skill is a folder with a SKILL.md and scripts that an agent such as Claude Code, Codex or Cursor loads when your request matches it. An OG image skill holds the design and the renderer; the agent does the parts that change from site to site: finding your posts, filling in titles, and wiring the tags into your framework.
An OG image generator for every post with Editorial OG Card
Editorial OG Card is free. Each card has a top rule with a kicker, topic and reading time, the headline in a large serif set as real text, a byline with initials or a photo and the post’s URL, and a block composition picked from the post’s slug, so a post keeps its card. It needs Node.js 18 or newer and Chrome, Chromium or Edge, plus internet access while rendering for the Google Fonts stylesheet.
Step 1: Install the skill
Paste the install prompt from its page into your agent, or run:
TerminalStep 2: Ask for cards
Claude CodeStep 3: It reads your posts into cards.json
The skill’s first script reads every
.md,.mdxand.markdownfile under the folder, skips drafts, and takes the title, kicker, topic, author and reading time from the front matter. Run it again when you add posts: your edits stay, new posts are added.TerminalStep 4: Edit the headlines
Wrap the one or two words that carry the point in
*asterisks*to set them in the accent colour. Headlines read best under 70 characters; the limit is 110.Step 5: Render and check
The render script checks every card first and lists every problem at once, renders the PNGs and confirms each is 1200×630.
--scale=2gives 2400×1260 for sharper images. It also writesog-preview.htmlwith every card side by side.TerminalStep 6: Wire up the tags
The agent adds the tags above to your post layout once, built from the slug, so every post gets its own image. The skill includes notes for Next.js, Astro, Eleventy, Jekyll and Hugo, and a
prebuildline if you want new cards on every build.
Other image skills cover the shares that aren’t link previews. Riso Quote Card and Pull Quote Card make quote cards in feed and story sizes, and Article Hero Illustration draws one illustration for an article at 16:9 and 1200×630. They are Pro; Editorial OG Card and Blueprint Architecture Diagram are free.
Test the preview before you share the link
The old image still shows after you changed it
Meta caches images by URL and won’t update them unless the URL changes. Give the new image a new file name or add a version to its path, then re-scrape in the Sharing Debugger.
No image at all
The URL is probably relative or blocked. Use the full
https://address, check it opens in a private window, and checkrobots.txt.X shows a small square instead of a wide card
Add
<meta name="twitter:card" content="summary_large_image" />. Withouttwitter:card, X’s docs say a summary card may be rendered from the OG tags.The animated GIF doesn’t move on X
X uses only the first frame of an animated GIF in a card. Use a still image.
The headline renders in a fallback font
In
@vercel/og, load the font file yourself inttf,otforwoff. In Editorial OG Card, check internet access for Google Fonts, or install the fonts and render offline as its Troubleshooting section describes.
Common questions
- What size should an OG image be?
- 1200×630 pixels. Meta asks for at least 1200 × 630 for high-resolution screens and a shape close to 1.91:1; X’s large card takes 300 × 157 up to 4096 × 4096 at 2:1, under 5 MB.
- What is the difference between og:image and twitter:image?
og:imageis the Open Graph tag that most apps read.twitter:imageis X’s own tag, and X falls back toog:imagewhen it is missing, so you usually only needog:imageplustwitter:card.- Why is my OG image not showing?
- Most often the URL is relative, blocked by
robots.txtor behind a login, or the platform cached an old version. Use an absolutehttps://URL, then re-scrape it in Meta’s Sharing Debugger. - Can an OG image be animated?
- Not on X: it uses only the first frame of an animated GIF. Make a still image; if you want motion in a share, post a video.
- Is there a free OG image generator for a whole blog?
- Yes. If you want to write the template in code, Satori is open source (MPL-2.0) and
@vercel/ogbuilds on it. Lookbk’s Editorial OG Card is a free skill that renders a card for every Markdown post and wires up the tags. - Do I need og:image:width and og:image:height?
- They aren’t required, but Meta’s docs say they let its crawler render the image right away instead of downloading it first to measure it.
Sources
What this guide says about other companies’ tools comes from their own documentation, checked on Nov 10, 2026.
- The Open Graph protocol (opens in a new tab)
- Meta for Developers: Images in Link Shares (opens in a new tab)
- Meta for Developers: A Guide to Sharing for Webmasters (opens in a new tab)
- X Developer Platform: Cards markup (Internet Archive copy, 1 February 2026) (opens in a new tab)
- X Developer Platform: Summary card with large image (Internet Archive copy, 4 February 2026) (opens in a new tab)
- Vercel docs: Open Graph (OG) Image Generation (opens in a new tab)
- Satori on GitHub (opens in a new tab)
- Next.js docs: opengraph-image and twitter-image (opens in a new tab)
- Next.js docs: generateMetadata (metadataBase, openGraph, twitter) (opens in a new tab)
Did this guide help?
Read next
All guidesBuild a landing page with Claude Code
Install a landing page skill in Claude Code, brief it from your README, check the result at four widths and put it live, with two finished examples.
Install a skill in any agent
Install a Lookbk skill in Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI or OpenCode: where each looks, how to check it loaded and how to run it.
Claude skills examples: real SKILL.md files, explained
Claude skills examples you can open and read: the anatomy of a real SKILL.md, Anthropic’s example skills by task, and visual skills shown with their output.
The best Claude skills, by what they make
A short list of the best Claude skills for documents, frontend design, video, slides, images and dev work: what each makes, who it suits, how to install it.
See a skill’s result before you install it.
Every skill page shows what it makes, what it needs and which agents can run it.




