# Can Void Replace Satori for Open Graph Images?

**Author:** Elian Van Cutsem
**Published:** 2026-12-04
**Tags:** Astro, Tooling, Web Development
**Description:** Can Void replace Satori and Resvg in my Astro build? I tried the new image API, generated 88 OG images and measured the difference.
**URL:** https://www.elian.codes/blog/26-12-04-generating-og-images-with-void

---
I was looking through some open Renovate pull requests for [my personal website](https://www.elian.codes) when something in the release notes for Void caught my eye.

[Void 1.13](https://void.cloud/guide/image-generation) can generate images from HTML and JSX now.

I'm already using Void to deploy this website to Cloudflare, and I'm generating Open Graph images for pretty much everything on it.

So, naturally, I wondered if I could get rid of two more dependencies.

As it turns out, I could. Sort of.

## How I was generating OG images in Astro

In case you haven't read about [my latest website rewrite](/blog/26-11-25-rewriting-my-website-astro-vite-plus-void), the entire thing is statically generated with Astro.

That includes the images you see when you share one of my articles or talks.

I'm using a couple of Astro endpoints to generate the images at build time. Those endpoints use [Satori](https://github.com/vercel/satori) to turn a tree of elements into an SVG, and [Resvg](https://github.com/thx/resvg-js) to turn that SVG into a PNG.

The rendering part looks a little like this (omitting the actual layout):

```ts
const svg = await satori(tree, {
  width: 1200,
  height: 630,
  fonts,
});

const png = new Resvg(svg).render().asPng();
```

This has been working fine. It's fast, doesn't require a browser, and I haven't had a reason to change it.

The thing that always felt a little odd to me was writing something that looks like CSS, but isn't quite the CSS I'd write for the rest of the website.

So being able to use actual HTML and CSS for my OG images sounded like a nice improvement.

## Using void/image from Astro

The examples in the Void documentation are generally written for Void apps. That's not quite what I'm building.

I'm using Void for deployment, not for the runtime. My Astro endpoints run in Node.js while generating the static website.

This matters because the default renderer in `void/image` uses a Cloudflare Browser Run binding. I don't have that binding in my Astro build, and I don't want to make a request to Cloudflare every time I generate an image locally.

Luckily, the API lets you bring your own renderer.

Here's a simplified version of what my OG card looks like now:

```ts
import { html } from "void/html";
import { renderOgImage } from "void/image";
import { renderWithChromium } from "./og-browser";

const card = html`
  <style>
    .title {
      font-size: 100px;
      text-shadow: 5px 0 #ff48b0;
    }
  </style>
  <h1 class="title">${title}</h1>
`;

const png = await renderOgImage(card, {
  renderer: renderWithChromium,
});
```

[`renderOgImage`](https://void.cloud/guide/og-images#await-rendering) defaults to 1200 by 630 pixels. The `html` template tag also escapes interpolated text, so a title containing HTML-like characters doesn't suddenly become markup.

In the actual template, I embed my three fonts and avatar as data URLs. Same pink, same blue, same typography. Just CSS this time around.

## Wait, why is there Playwright in my project now?

Well, somebody still needs to turn that HTML into a PNG.

For my first attempt, I used a local Chromium browser controlled by Playwright. Here's the initial implementation of `src/lib/og-browser.ts`, where each image gets its own browser:

```ts
import { chromium } from "playwright";
import type { ImageRenderer } from "void/image";

export const renderWithChromium: ImageRenderer<never, never> = async (
  element,
  { width, height },
) => {
  const browser = await chromium.launch();

  try {
    const page = await browser.newPage({
      viewport: { width, height },
      deviceScaleFactor: 1,
    });

    await page.route("**/*", (route) => route.abort());

    await page.setContent(
      `<!doctype html><html lang="en"><head><meta charset="utf-8"></head><body>${String(await element)}</body></html>`,
    );

    await page.evaluate(async () => {
      await document.fonts.ready;
      await Promise.all(Array.from(document.images, (image) => image.decode()));
    });

    return new Uint8Array(await page.screenshot({ type: "png" }));
  } finally {
    await browser.close();
  }
};
```

The interesting bit here is that this function only deals with rendering. It gets the HTML and the dimensions, blocks network requests (the fonts and avatar are embedded), waits until the assets are ready, and returns PNG bytes. Even if something goes wrong while generating an image, the browser is closed. That turned out to be the expensive part, though. More on that in a minute.

There is no browser involved in serving the website. Only in building it.

My Astro endpoints still return the same thing:

```ts
return new Response(png, {
  headers: { "Content-Type": "image/png" },
});
```

And the URL of every existing OG image stays the same.

I do need to install Chromium once on my machine, though:

```bash
pnpm exec playwright install chromium
```

And on my Linux CI runner, I need the system dependencies as well:

```bash
pnpm exec playwright install --with-deps chromium
```

So much for getting rid of dependencies.

## Why use void/image when I could just use Playwright?

I could absolutely skip Void here, pass an HTML string straight to Playwright and take a screenshot. For a static Astro site, that would work just fine.

But I'd be tying the code that describes my OG card to the code that renders it.

With `void/image`, that distinction is part of the API. I use `html` to describe the card, `renderOgImage` to request a 1200 × 630 PNG, and pass in whichever renderer I want to use. The Astro endpoint doesn't have to know anything about launching a browser.

If I wanted to generate images on demand from a Void app later, I could try the default Cloudflare Browser Run renderer instead. Or I could try a browser-free third-party renderer that implements the same contract.

I'd still need to check that the new backend supports the CSS and fonts I'm using, of course. But I wouldn't have to start over with a different image template just to benchmark another renderer.

That's the part of the API I find interesting. It's not a way to avoid using Playwright today. It's a way to avoid having to rewrite the rest of the code if I stop using Playwright tomorrow.

## What do the images look like?

Here's the OG image for one of my longer article titles, generated by both implementations.

**Satori and Resvg:**

![The original blue and pink Open Graph card rendered with Satori and Resvg](/assets/img/og-renderer-comparison/satori.png)

**Void and Chromium:**

![The same article title and brand rendered with Void and Chromium](/assets/img/og-renderer-comparison/void.png)

If you look closely, there are some small differences in the rendering of the fonts. But for the most part, it's the same image. Even the title wraps across the same three lines.

That's exactly what I was going for. I wasn't trying to redesign the OG images again.

## Is it faster?

No. Not in my implementation, anyway.

I ran two full builds of the website with each renderer on my M4 Pro, using Node 26.14.0 and pnpm 12.26.0. That's `pnpm build`, which includes Astro's type check, not just the time it takes to produce a PNG.

Both versions generated the same 88 OG images at 1200 × 630 pixels.

| Renderer | First build (s) | Second build (s) | PNG size (MB) |
| --- | ---: | ---: | ---: |
| Satori + Resvg | 20.87 | 13.39 | 5.94 |
| Void + Chromium | 25.09 | 21.07 | 6.23 |

The second set of builds is a better comparison: they ran sequentially with warm caches. During the first run I was also installing the dependencies for the baseline near the end of the Void build. These are just local timings, not a proper CI benchmark.

Going from 13.39 to 21.07 seconds means the warm-cache build took about **57% longer**. That sounds like a rather significant performance regression.

In absolute terms, though, it's 7.68 seconds. For a website that rebuilds once a day, that's a rather different story.

I used Void 1.13.0 for the experiment.

There was a pretty obvious inefficiency in my first implementation: I was starting Chromium 88 times.

So I tried two more approaches before drawing too many conclusions.

## What if I just reuse Chromium?

Instead of launching a browser for every card, I keep one browser process around and create a fresh browser context for every render. I still close the context in a `finally` block, and the browser closes after one second without any active renders.

The renderer keeps the in-flight browser launch as a promise, so concurrent requests share it as well. If Chromium fails to launch or disconnects, the next render can try again.

The HTML, CSS and the `renderOgImage` call stay exactly the same. The changes are all inside the renderer.

I added tests for concurrent renders, cleanup after an idle period and recovery after a failed image load. And to make sure I wasn't accidentally measuring 88 browser launches again, I logged each launch in the benchmark copy.

One browser per build, all 88 images. In each of the three runs.

## Can I get rid of the browser entirely?

Void's [image generation documentation](https://void.cloud/guide/image-generation#third-party-renderer) mentions [void-image-takumi](https://github.com/yangshun/void-image-takumi), a browser-free renderer based on [Takumi](https://takumi.kane.tw/docs/).

The adapter wasn't available on npm when I tried it, but Takumi itself was. So I made a tiny adapter using `takumi-js` 2.22.1 in a separate experimental copy of my website.

```ts
import { render } from "takumi-js";
import type { ImageRenderer } from "void/image";

const renderWithTakumi: ImageRenderer<never, Uint8Array> = async (
  element,
  { width, height, fonts },
) =>
  new Uint8Array(
    await render(String(await element), {
      width,
      height,
      fonts,
      emoji: "from-font",
      images: { allowUrl: (url) => url.startsWith("data:") },
    }),
  );
```

The first attempt rendered everything, but my display font was replaced by a fallback. Definitely not the look I was going for.

So I switched the same three font faces from WOFF to WOFF2 and supplied their bytes through Void's `fonts` option instead of declaring them in the card's stylesheet:

```ts
const png = await renderOgImage(card, {
  renderer: renderWithTakumi,
  fonts: [
    { name: "Display", data: display, weight: 900 },
    { name: "Body", data: body, weight: 500 },
    { name: "Mono", data: mono, weight: 400 },
  ],
});
```

The card's markup and the rest of its CSS remained the same. Takumi uses its native renderer in Node.js, so there's no Chromium installation involved.

**Void and Takumi:**

![The same Open Graph card rendered with the native Takumi renderer](/assets/img/og-renderer-comparison/takumi.png)

Not pixel-perfect compared to the Chromium output, but pretty close. I checked contact sheets of all 88 images and didn't spot any missing fonts or clipped titles.

And that's the renderer abstraction at work. I didn't have to move back to an entirely different component format to try another rendering engine.

The adapter linked from the Void documentation does considerably more than mine. It has font fallbacks for multiple writing systems, emoji rendering, remote image handling and caching. Its [implementation uses Takumi's WebAssembly backend](https://github.com/yangshun/void-image-takumi/blob/main/src/image-renderer.ts), so it can also run in Cloudflare Workers.

I'm not rendering images on a Worker, though. And I already have all the fonts and images I need locally. For this website, a small adapter using Takumi's native Node.js backend is enough. I don't know how the two adapters compare in performance; these benchmarks are for my own adapter.

## Okay, now let's compare all four

I ran one warm-up and three measured full builds for each renderer, rotating the order between rounds on the same M4 Pro. Each renderer had its own dependency installation, completed before timing started, and all the Takumi runs used the corrected font configuration. Every build generated the same 88 PNG paths at 1200 × 630. I measured wall-clock time, including Astro's type check and the time needed to close the shared browser.

All times are in seconds; PNG sizes are in MB. The Chromium and Takumi rows all use `void/image`, and launches are per build.

| Renderer | Run 1 | Run 2 | Run 3 | Median | Launches | PNG (MB) |
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| Satori + Resvg | 13.44 | 13.38 | 14.16 | 13.44 | 0 | 5.94 |
| Chromium (per image) | 20.70 | 21.45 | 20.62 | 20.70 | 88 | 6.23 |
| Chromium (reused) | 12.82 | 12.57 | 12.50 | 12.57 | 1 | 6.24 |
| Takumi | 4.96 | 4.88 | 4.74 | 4.88 | 0 | 3.82 |

The biggest difference between my two Chromium implementations is the browser lifecycle. Reusing one browser reduced the median build time by 8.13 seconds, or about 39%. It's now essentially on par with Satori, even a little ahead in these runs.

I also compared the decoded pixels of the last run of both Chromium implementations. 40 of the 88 cards were identical; in the others, at most 2,716 pixels differed (0.36% of a card), and the largest change to any color channel was 3 out of 255. Visually, they're the same cards.

But the most surprising result was Takumi. The median full build was 4.88 seconds, about 64% shorter than the Satori baseline, and the PNGs were about 36% smaller in total.

Astro also reports the time taken by each individual route. Summing the 88 OG route timings and taking the median of the three sums gives 9.37 seconds for Satori, 16.44 seconds for a browser per card, 8.11 seconds for a reused browser, and 0.39 seconds for Takumi. That's not the complete build time, but it helps explain where the difference comes from.

These numbers aren't a universal claim about any of these libraries. It's 88 specific images on my laptop, using this particular layout and these particular fonts. It's not a Linux CI benchmark either. But it's much more useful than my first comparison.

## Would I replace Satori with Void?

For this website? Yes, but not with the implementation I started out with.

My first implementation was slower than Satori. My second one was about as fast. And I now have a third option that's considerably faster without requiring a browser at all.

The extra 7.68 seconds in my initial experiment wasn't a dealbreaker for a daily rebuild, even though 57% sounded pretty bad. But it also turned out to be largely avoidable.

I like that I can write regular CSS and keep the renderer separate from the card itself.

The Chromium version still needs Playwright and a browser installation. The Takumi experiment is much closer to the dependency cleanup I was hoping for, though it does introduce a native rendering dependency and a little extra font setup.

Satori was doing its job perfectly fine without any of that.

I've switched the local website to my Takumi adapter. The final implementation generated the same 88 PNGs as the Takumi benchmark, byte for byte, and I could remove Playwright and the Chromium installation steps from the project.

I also ran the same dependency installation, checks, tests, full build and link checker in a Linux x86-64 container (Node 26.14.0), without Chromium. All 17 tests and all 88 OG image routes passed. Of the Linux PNGs, 86 were byte-for-byte identical to the macOS results; the other two differed in fewer than 220 pixels each.

The website is still statically generated, and the Cloudflare deployment configuration doesn't change. The [GitHub Actions build](https://github.com/ElianCodes/ElianCodes-frontend/actions/runs/47434466506) passed on Ubuntu too, without needing a browser installation.

For now, the thing I find most interesting about `void/image` isn't that it can render a PNG. It's that I can use the same HTML template with different rendering backends.

Turns out I learned more from trying another renderer than I did from simply replacing Satori.

Because apparently generating a pink and blue image for a blog post isn't complicated enough yet.

You can find the [OG image template](https://github.com/ElianCodes/ElianCodes-frontend/blob/36aa1db5947b549c71af0f3e406e00c6529e78f6/src/lib/og.ts) and [native Takumi adapter](https://github.com/ElianCodes/ElianCodes-frontend/blob/36aa1db5947b549c71af0f3e406e00c6529e78f6/src/lib/og-takumi.ts) on GitHub.
