{"id":307,"date":"2026-10-15T21:33:06","date_gmt":"2026-10-15T21:33:06","guid":{"rendered":"https:\/\/blog.skndan.com\/jsontoimg\/2026\/10\/15\/build-vs-buy-image-generation\/"},"modified":"2026-11-17T13:33:05","modified_gmt":"2026-11-17T13:33:05","slug":"build-vs-buy-image-generation","status":"publish","type":"post","link":"https:\/\/blog.skndan.com\/jsontoimg\/2026\/10\/15\/build-vs-buy-image-generation\/","title":{"rendered":"Build vs Buy Image Generation: The Hidden Cost of Puppeteer"},"content":{"rendered":"<p>Build vs buy image generation is mostly a question about what you are willing to be on call for. A script that screenshots a page takes an afternoon. A renderer that stays up for two years is a different project, and the gap between those two is where the cost hides.<\/p>\n<h2>What you own when you build<\/h2>\n<p>The first version is a browser, a page, and a screenshot call, as in <a href=\"https:\/\/developer.chrome.com\/docs\/puppeteer\">Chrome&#39;s Puppeteer guide<\/a>. Then the list grows:<\/p>\n<table>\n<thead>\n<tr>\n<th>Component<\/th>\n<th>What it means in practice<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Browser binary<\/td>\n<td><a href=\"https:\/\/pptr.dev\/troubleshooting\">Puppeteer<\/a> and <a href=\"https:\/\/playwright.dev\/docs\/browsers\">Playwright<\/a> both download and pin browser builds, so upgrades are your change window<\/td>\n<\/tr>\n<tr>\n<td>Fonts<\/td>\n<td>Missing fonts on the server render as fallback glyphs, and the bug only shows in production<\/td>\n<\/tr>\n<tr>\n<td>Load timing<\/td>\n<td>Deciding when a page is ready is a heuristic you tune per template<\/td>\n<\/tr>\n<tr>\n<td>Concurrency<\/td>\n<td>Browsers are heavy processes; a burst of renders needs a queue and a pool<\/td>\n<\/tr>\n<tr>\n<td>Storage and caching<\/td>\n<td>Rendered files need a bucket, cache headers, and cleanup<\/td>\n<\/tr>\n<tr>\n<td>Signed URLs<\/td>\n<td><code>&lt;img&gt;<\/code> and <code>og:image<\/code> cannot carry a secret, so you build and verify signatures yourself<\/td>\n<\/tr>\n<tr>\n<td>Retries and webhooks<\/td>\n<td>Slow renders need a 503 and <code>Retry-After<\/code> path, and completion callbacks need idempotency<\/td>\n<\/tr>\n<tr>\n<td>The layout<\/td>\n<td>Every design change is a code change and a deploy<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>None of these is hard alone. Together they are a product that nobody was hired to maintain.<\/p>\n<h2>What you give up when you buy<\/h2>\n<p>Control. A template API draws what its editor can draw, so arbitrary CSS and live-page capture are out of scope. You also take on a vendor, and your layer names become a contract; export your templates and keep the payload schema in your own repo.<\/p>\n<h2>When building is the right call<\/h2>\n<ul>\n<li>The layout is the product, such as a screenshot service or a design tool.<\/li>\n<li>You already operate headless browsers for another purpose and have the monitoring in place.<\/li>\n<li>Volume is tiny and stable, and no designer will ever touch the output.<\/li>\n<li>You need HTML features no editor offers.<\/li>\n<\/ul>\n<h2>When buying is the right call<\/h2>\n<ul>\n<li>One layout repeats across records: Open Graph cards, certificates, product banners, email heroes.<\/li>\n<li>A non-engineer edits the design.<\/li>\n<li>Renders must be reliable at a burst, such as a registration list closing or a catalog price change.<\/li>\n<\/ul>\n<p>jsontoimg covers the second list with <code>POST \/api\/v1\/render<\/code>, signed URLs, 50-job batches, and webhooks. Prices for it and seven other tools are in <a href=\"https:\/\/jsontoimg.com\/blog\/image-generation-api-pricing-comparison\">Image Generation API Pricing<\/a>. The technical comparison of the two approaches is in <a href=\"https:\/\/jsontoimg.com\/blog\/html-to-image-api-vs-template-api\">HTML to Image API vs Template API<\/a>.<\/p>\n<h2>FAQ<\/h2>\n<h3>Is it cheaper to build an image generation service myself?<\/h3>\n<p>The first version is cheaper to start. Running it is where costs accumulate: browser upgrades, fonts, concurrency, storage, signed URLs, and every layout change shipping as a deploy.<\/p>\n<h3>When should I run my own headless Chrome?<\/h3>\n<p>When the layout is the product, when you already operate browsers and monitor them, or when you need arbitrary HTML that no template editor supports.<\/p>\n<h3>What is the main risk of buying?<\/h3>\n<p>Lock-in on layer names and editor capability. Keep your payload schema in your own repository so a migration means rebuilding templates, not rewriting every caller.<\/p>\n<h3>Can I migrate from Puppeteer to a template API gradually?<\/h3>\n<p>Yes. Move one repeating layout first, such as Open Graph cards, behind the API and keep the screenshot script for pages that need arbitrary HTML.<\/p>\n<h2>Related Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/lessons-from-launching-a-developer-first-image-api\">Lessons from launching a developer-first image API<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/product\/image-generation-api\">Fully managed image generation API<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/tools\/free-image-api-cost-calculator\">Image API cost calculator<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/json-to-image-converter\">How JSON-to-image conversion works<\/a> \u2014 the pillar guide<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/image-generation-api-pricing-comparison\">Image generation API pricing<\/a> \u2014 the numbers<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/why-i-built-a-json-to-image-api-instead-of-using-puppeteer\">Why I built a JSON-to-image API instead of Puppeteer<\/a> \u2014 the origin story<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/image-generation-api-buyers-guide\">Image generation API: 8 questions<\/a> \u2014 vendor checklist<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Every component you own when you run headless Chrome for image generation, and the cases where building is still the right call.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-307","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/comments?post=307"}],"version-history":[{"count":1,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/307\/revisions"}],"predecessor-version":[{"id":347,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/307\/revisions\/347"}],"wp:attachment":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/media?parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/categories?post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/tags?post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}