Skip to main content
The scale option controls PNG rasterization quality via Resvg. It does not change the layout space that Satori uses. Templates should always design against the original width and height — never multiply dimensions or font sizes by scale.
Do not use scale for layout. Satori always renders at width × height (default 1200 × 630). Only Resvg uses scale to produce a higher-resolution PNG from the same SVG.

Two-Stage Rendering

From renderTemplate:

What scale Does and Does Not Do

  • Increase final PNG pixel dimensions (width × scale, height × scale)
  • Improve text sharpness and edge anti-aliasing on retina displays
  • Increase output file size (roughly proportional to scale²)
  • Change width / height passed to your template renderer
  • Affect font sizes, padding, margins, or gap values in Satori
  • Require template code changes when callers request higher quality

Correct vs Incorrect Usage

Output Dimensions

Base canvas: 1200 × 630 (Open Graph standard).

Constraints

  • Float values supported: 1.25, 1.5, 2, etc.
  • Clamped to [1, 4] — values below 1 become 1, above 4 become 4
  • File size grows roughly with scale² (e.g. scale: 2 ≈ 4× larger PNG)
  • scale is passed to the renderer for awareness but must be ignored for layout

Examples

Why This Design?

Satori calculates layout using absolute pixel values (text-[64px], p-16, etc.). If scale changed the layout space, every font size and spacing value would need manual adjustment. By keeping Satori at the original dimensions and upscaling only at rasterization:
  1. Templates are scale-agnostic — write once, render at any quality
  2. Font sizes stay correct64px always means 64 layout pixels
  3. Vector SVG scales cleanly — Resvg rasterizes the same SVG at higher resolution without layout drift
Use scale: 2 in production for retina-quality OG images. The template code does not need to change — only the renderToImage options.