# Dynamic OG images compared: Satori, a headless browser or a template API

Source: https://snapsbrew.com/blog/dynamic-og-images-compared

Use Satori (or @vercel/og) when a developer owns the design and the layout is simple flexbox. Use a headless browser when you need full CSS and can run Chrome. Use a template API when a designer owns the design or many sites share it. All three can cache the image so that each one renders once.

By [Alejandro Medina](https://amedina.me), maintainer of Snapsbrew. Published 27 November 2026. Last updated 27 November 2026.

On this page

- [What are the three ways to make a dynamic OG image?](#what-are-the-three-ways-to-make-a-dynamic-og-image)
- [How does Satori work, and where does it break?](#how-does-satori-work-and-where-does-it-break)
- [What does a headless browser give you?](#what-does-a-headless-browser-give-you)
- [What does a template API change?](#what-does-a-template-api-change)
- [Which one should you pick?](#which-one-should-you-pick)
- [How do you keep the cost of each image low?](#how-do-you-keep-the-cost-of-each-image-low)
- [What I would do today](#what-i-would-do-today)

Legendsverse is a checklist of Marvel Legends action figures. I run it, and it is the first site that used Snapsbrew. It has thousands of figure pages, and each page has a social card with the price, the wave and the market value of the figure. The market value changes every week.

The first version re-rendered every card each week through the API. Thousands of renders, and most of those cards were never shared anywhere. Nobody posts the page of an obscure 2009 wave figure to X. So the images were made, stored and never seen.

The fix was not a faster renderer. It was to render on demand: put a URL in the `og:image` tag that makes the image the first time a crawler asks for it. That is the core idea behind every method in this post. The methods differ in what draws the pixels.

## What are the three ways to make a dynamic OG image?

| Satori and @vercel/og | A headless browser                      | A template API               |                                           |
| --------------------- | --------------------------------------- | ---------------------------- | ----------------------------------------- |
| What draws the image  | Its own layout engine, to SVG, then PNG | Chrome, Firefox or WebKit    | A service that runs a browser for you     |
| Who writes the design | A developer, in JSX                     | A developer, in HTML and CSS | A designer, in a visual editor            |
| CSS support           | A subset                                | Full                         | Full, inside the editor                   |
| What you run          | A function in your app                  | A browser on your server     | Nothing (hosted) or one app (self-hosted) |
| A design change needs | A deploy                                | A deploy                     | A publish in the editor                   |

Each row hides a trade-off. The sections below give the details, with the limits that each project states in its own docs.

## How does Satori work, and where does it break?

[Satori](https://github.com/vercel/satori) takes JSX and writes an SVG string. It does not start a browser. It has its own layout engine, so it starts fast and runs in places where Chrome cannot run, such as an edge function. It is open source under the MPL-2.0 license.

The price of that speed is CSS. The Satori README says it "supports a limited subset of HTML and CSS features" and that it "does not guarantee that the SVG will 100% match the browser-rendered HTML output". You give it fonts as data. React hooks do not work, because there is no browser and no state.

[@vercel/og](https://vercel.com/docs/og-image-generation) wraps Satori and Resvg and returns a PNG. Next.js exposes it as `ImageResponse` from `next/og`. The Vercel docs list three limits that you meet early:

- "Only flexbox (display: flex) and a subset of CSS properties are supported. Advanced layouts (display: grid) will not work."
- "Only ttf, otf, and woff font formats are supported."
- "Maximum bundle size of 500KB." The bundle includes your JSX, CSS, fonts and images.

The two docs do not agree. The Satori README now says that it uses Taffy to lay out flexbox, grid and block layouts, and that it reads WOFF2 fonts. The Vercel page still says flexbox only. On 27 November 2026, the version that you deploy decides. Test your layout before you trust either page.

If you like the Satori model but not its CSS gaps, look at [Takumi](https://github.com/kane50613/takumi). It is a Rust layout engine under the MIT or Apache-2.0 license, with an `ImageResponse` that follows `next/og`. Its README says that its block, inline, flexbox, grid and table layout "ports Chromium's Blink". It is newer, so check that it covers your layout.

**Pick Satori when** a developer owns a simple design, the site is on Next.js or another JavaScript runtime, and you want no second service.

## What does a headless browser give you?

[Puppeteer](https://pptr.dev/api/puppeteer.screenshotoptions) and [Playwright](https://playwright.dev/docs/api/class-page#page-screenshot) open a real browser and take a screenshot of a page. Both are open source under Apache-2.0, and both write PNG, JPEG or WebP. You get all of CSS: grid, web fonts, SVG filters, anything that Chrome draws.

You also get Chrome. A browser needs memory, it needs fonts installed on the server, and it needs a pool or a queue when many requests arrive at the same time. If you put Puppeteer inside a web request with no limit, one burst of crawlers can start a lot of browsers at once.

Two open-source servers do the browser part for you:

- [Gotenberg](https://gotenberg.dev/docs/chromium/screenshot-html) (MIT) is a Docker API for PDFs. It also has screenshot routes for HTML, a URL or Markdown, with PNG, JPEG or WebP output. You send finished HTML. It has no templates and no editor.
- [Browserless](https://github.com/browserless/browserless) runs pooled headless browsers in Docker. Check the license first. It is dual-licensed under the SSPL and a commercial license, and its README says that closed-source commercial use needs a paid license.

**Pick a headless browser when** you need full CSS, a developer owns the HTML, and you already run servers.

## What does a template API change?

A template API moves the design out of your code. Someone builds a template in a visual editor, with named layers such as `title` and `photo`. Your code sends only the values. The service renders the image with a browser and returns a URL.

The change is about who can edit the image. With Satori or Puppeteer, a new font or a moved logo is a pull request. With a template, it is a publish in the editor, and the next render uses the new design.

You can rent a template API or run one:

- **Hosted:** [Bannerbear](https://snapsbrew.com/compare/bannerbear.md), [Placid](https://snapsbrew.com/compare/placid.md) and [HTML/CSS to Image](https://snapsbrew.com/compare/htmlcsstoimage.md) run the renderer, the storage and the editor for you, for a monthly fee. The comparison pages list what each one offers, with links to their own pages.
- **Self-hosted:** [Snapsbrew](https://snapsbrew.com/docs/getting-started/introduction.md) is the open-source option that I maintain. It runs on your server with Docker Compose and renders with headless Chrome through Browserless or Browsershot. You pay for the server, not for each image.

Bannerbear, Placid and HTML/CSS to Image each list a URL-based option on their own pages, and Snapsbrew has signed URLs: an image URL that your server signs with a secret, so that the URL itself renders the image. That is the on-demand pattern from the Legendsverse story. Your app makes no API call. The crawler makes the request, and the first request renders.

**Pick a template API when** a designer owns the design, several sites or teams share templates, or the same template also makes other images, such as PDFs or Instagram posts.

## Which one should you pick?

| Your situation                                                             | The fit                                                   |
| -------------------------------------------------------------------------- | --------------------------------------------------------- |
| A Next.js blog, a developer does the design, the layout is simple          | next/og and Satori                                        |
| You need CSS grid, filters or exact browser output, and you run servers    | Puppeteer or Playwright behind a queue, or Gotenberg      |
| A designer changes the cards, and you do not want a deploy for each change | A template API                                            |
| Thousands of pages, few of them shared                                     | Any method with on-demand render and a cache              |
| The images and the data must stay on your servers                          | Satori, a headless browser, or a self-hosted template API |
| You do not want to run anything                                            | A hosted template API                                     |

## How do you keep the cost of each image low?

The method matters less than the cache. An OG image changes only when its data changes, so render it once and keep it.

- **Put the data in the URL.** If the title is in the URL, a new title makes a new URL, and the old cached image is never wrong. Snapsbrew signed URLs work this way, and so does a `next/og` route with query parameters.
- **Cache at the edge.** For a Satori or Puppeteer route, send a long `Cache-Control` header, so that the CDN answers later requests.
- **Render on the first request.** Legendsverse stopped rendering cards that nobody shares. The render work now follows the real shares, not the size of the catalog.
- **Warm the important ones.** The first crawler waits for the render. For a launch post, request the image URL one time right after you publish.

## What I would do today

For one Next.js site with a developer-owned card, I would use `next/og` and stop there. It is the least to run.

For anything with a designer, several sites, or images beyond the OG card, I would use a template with a signed URL. That is why Snapsbrew exists. If you do not want to run a server, a hosted template API is the honest choice, and the [comparison pages](https://snapsbrew.com/compare.md) show where each one is stronger.

## Questions

Is Satori a headless browser?

No. Satori has its own layout engine and writes SVG. It supports a subset of HTML and CSS, and its README says that the output does not always match the browser. To get a PNG, a second library such as resvg converts the SVG.

Does @vercel/og support CSS grid?

The Vercel docs say no, only flexbox. The Satori README, updated later, says that Satori now lays out flexbox, grid and block layouts. Test your layout on the version that you deploy.

Is a headless browser too slow for OG images?

It is slower and heavier than Satori, but an OG image renders once and then comes from a cache. The cost that matters is the memory of Chrome on your server, not the time of one render.

Can I mix the methods?

Yes. Many sites use a static image for most pages and a dynamic image only for the pages that people share, such as posts and products.

## Related pages

- [How to generate dynamic OG images in Next.js](https://snapsbrew.com/guides/nextjs-og-images.md)
- [How to generate dynamic OG images in Nuxt](https://snapsbrew.com/guides/nuxt-og-images.md)
- [How to generate OG images in Laravel](https://snapsbrew.com/guides/laravel-og-images.md)
- [Snapsbrew and HTML/CSS to Image](https://snapsbrew.com/compare/htmlcsstoimage.md)
- [The best open-source image generation APIs and tools](https://snapsbrew.com/blog/best-open-source-image-generation-api.md)

## Run it on your own server

Docker Compose starts the app, the queue, MySQL, Redis and the renderer together.

[Self-host it](https://snapsbrew.com/docs/getting-started/installation-docker.md) [View on GitHub](https://github.com/amedina068/snapsbrew)

```bash
git clone https://github.com/amedina068/snapsbrew.git
cd snapsbrew
cp .env.docker.example .env   # then fill in .env
docker compose up -d --build
```
