OG Image Generators Compared: OGMagic vs @vercel/og vs Cloudinary vs DIY
There are dozens of ways to generate Open Graph images. Here's an honest comparison of the most popular approaches so you can pick the right one for your project.
Contents
TL;DR — Quick Comparison Table
Written by OGMagic. Setup time, rendering speed, and hosting costs depend on your design and workload.
1. OGMagic — The Hosted Image API
OGMagic creates your image through an authenticated API request or the visual editor. Save the returned public URL in your metadata; it contains no credentials.
// Run on your server, at build time, or when publishing content.
const response = await fetch("https://www.ogmagic.dev/api/images", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.OGMAGIC_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ title: "My article", template: "gradient-mesh" }),
});
if (!response.ok) throw new Error("Image creation failed");
const image = await response.json();
// Save image.url with your content; use it in og:image and twitter:image.Pros
- ✓ Use HTTP or the editor without maintaining image rendering code
- ✓ Works with any framework, any language, any platform
- ✓ 50+ professionally designed templates
- ✓ Visual editor to preview and customize designs
- ✓ €10 / US $12 one-time (not monthly) for Pro tier
- ✓ Email access; no password for free tier
Cons
- ✗ Less design flexibility than building your own with Satori
- ✗ Depends on external service (OGMagic servers)
- ✗ Free tier limited to 50 new images per 30 days
Best for
Developers who want great-looking OG images without spending time on implementation. Blogs, documentation sites, SaaS landing pages, portfolio sites — anywhere you want polished social previews without the overhead.
2. @vercel/og — Satori + Edge Functions
Vercel's @vercel/og package uses Satori to render JSX to images. You maintain the layout and rendering route. Check the supported runtime for your deployment in the Vercel documentation.
import { ImageResponse } from '@vercel/og';
export const runtime = 'edge';
export async function GET(request: Request) {
const { searchParams } = new URL(request.url);
const title = searchParams.get('title') ?? 'My Site';
return new ImageResponse(
(
<div style={{
display: 'flex',
fontSize: 60,
background: 'linear-gradient(to bottom, #1a1a2e, #16213e)',
width: '100%',
height: '100%',
alignItems: 'center',
justifyContent: 'center',
color: 'white',
}}>
{title}
</div>
),
{ width: 1200, height: 630 }
);
}Pros
- ✓ Full design control — write any JSX layout
- ✓ Rendering can live with your application
- ✓ Custom fonts, logos, avatars
- ✓ Hosting and caching can use your existing deployment
Cons
- ✗ You need a compatible runtime and deployment configuration
- ✗ You have to design and code every template from scratch
- ✗ Satori has CSS limitations (no grid, limited flexbox, no gradients in text)
- ✗ Debugging layouts in Satori is painful — no DevTools, trial-and-error
- ✗ Custom fonts require manual loading and binary embedding
- ✗ No visual editor — code-only workflow
Best for
Teams already on Vercel who need highly customized, brand-specific OG images and have the engineering time to build and maintain them. If your OG image needs to include dynamic data like user avatars, project stats, or custom graphics, @vercel/og gives you that flexibility.
3. Cloudinary — Image Transformation
Cloudinary manages media assets and supports image and text layers through transformations. Its layer documentation explains how to compose these into a preview image.
https://res.cloudinary.com/demo/image/upload/w_1200,h_630,c_fill/l_text:Arial_60_bold:My%20Blog%20Post,co_white,g_center/bg_gradient.jpgPros
- ✓ Powerful image manipulation (overlays, effects, crops)
- ✓ CDN-delivered, fast globally
- ✓ Works with any stack
Cons
- ✗ URL syntax is complex and hard to read/debug
- ✗ Review transformation, storage, and delivery allowances for your workload
- ✗ Not designed for OG images specifically
- ✗ Limited text layout control compared to HTML/CSS-based approaches
- ✗ Need to upload and manage base images
Best for
Teams already using Cloudinary for image management who want to add OG image generation without a new service. For an OG-only project, compare the extra asset management work with a purpose-built service.
4. DIY — Puppeteer / Playwright
The "build it yourself" approach: spin up a headless browser, render an HTML page, take a screenshot. Maximum flexibility, maximum effort.
const puppeteer = require('puppeteer');
async function generateOG(title, description) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 1200, height: 630 });
await page.setContent(`
<html>
<body style="margin:0; display:flex; align-items:center;
justify-content:center; background:#1a1a2e; color:white;
font-family:sans-serif; height:100vh">
<div>
<h1>${title}</h1>
<p>${description}</p>
</div>
</body>
</html>
`);
const screenshot = await page.screenshot({ type: 'png' });
await browser.close();
return screenshot;
}Pros
- ✓ 100% design freedom — real browser rendering
- ✓ Use any CSS, any font, any layout
- ✓ No external dependencies or services
- ✓ Can capture complex, interactive designs
Cons
- ✗ Browser startup and page loading add resource use; measure with your own layouts
- ✗ Resource-heavy — needs a server with enough RAM for Chromium
- ✗ Won't run on serverless/edge (Chromium too large)
- ✗ You maintain everything: templates, server, scaling, caching
- ✗ Security risk — rendering untrusted HTML in a browser
Best for
Build-time generation where speed doesn't matter (static site generators), or projects with extremely custom requirements that can't be met by any service. If you're generating thousands of images at build time and have server infrastructure, this works.
When to Use Each
Choose OGMagic if...
You want beautiful OG images with zero implementation effort. Great for blogs, docs, SaaS products, and portfolios. Works with any tech stack.
Choose @vercel/og if...
You're on Vercel, need pixel-perfect brand-specific designs, and have engineering time to build custom templates in JSX.
Choose Cloudinary if...
You already pay for Cloudinary and want to add OG images without a new vendor. Otherwise, too expensive for just OG images.
Choose DIY if...
You need full browser rendering, have server infrastructure, and generate images at build time rather than on-demand.
The Verdict
For most developers, the question comes down to: how much time do you want to spend on OG images?
If the answer is "as little as possible" — OGMagic provides ready-made templates through the editor and an authenticated API. Create an image, save its returned URL, and publish it in your metadata.
If you need deep customization, @vercel/og gives you control of the design. Plan for implementing and maintaining the template and rendering route.
Everything else is either overkill (Cloudinary, Puppeteer) or requires meaningful engineering investment for what is, at the end of the day, a preview image.
Ready to try OGMagic?
50 new images per 30 days, email access. Or upgrade to Pro for €10 / US $12 one-time and get 500 new images per 30 days + 50 templates.
Related Articles
The OGMagic newsletter
Get your 20% off Pro code
Join the OGMagic newsletter for a 20% discount code for Pro, Open Graph tips, and new templates.
Subscribe to OGMagic emails. Confirm by email; unsubscribe anytime.