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.
Two-Stage Rendering
From
renderTemplate:
What scale Does and Does Not Do
scale DOES
scale DOES
- 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²)
scale does NOT
scale does NOT
- Change
width/heightpassed 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 below1become1, above4become4 - File size grows roughly with
scale²(e.g.scale: 2≈ 4× larger PNG) scaleis 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:
- Templates are scale-agnostic — write once, render at any quality
- Font sizes stay correct —
64pxalways means 64 layout pixels - Vector SVG scales cleanly — Resvg rasterizes the same SVG at higher resolution without layout drift