Skip to content

Customizing Styles

Every visual aspect of a generated image is configurable through the style object. You only need to include the fields you want to change — everything else falls back to sensible defaults.

A hex color string that drives the primary brand color in the image. Used for:

  • The accent bar in the default template
  • The divider line in social-card
  • The CTA element in email-banner
  • The tag/pill badge border and background tint
{ "style": { "accent": "#38ef7d" } }

Any valid 6-digit or 3-digit hex color is accepted (#38ef7d, #fff, #FF5733). The engine automatically computes a contrasting foreground color for text rendered on top of the accent element, so you do not need to worry about readability.

Default: #38ef7d

The font family to use for all text in the image. Must be one of the 8 pre-loaded fonts:

API NameCharacter
OutfitModern geometric sans-serif
InterNeutral, highly legible
Playfair DisplayElegant serif for editorial
SoraFriendly rounded sans-serif
Space GroteskTechy, slightly irregular
JetBrains MonoMonospaced — great for developer tools
Noto Sans JPLatin + Japanese CJK
Noto Sans ARLatin + Arabic
{ "style": { "font": "Playfair Display" } }

Default: Outfit

See the Available Fonts page for full details including weights and script coverage.

The font size for the title in pixels. Affects how many lines the title wraps to before hitting the max-lines limit.

  • Minimum: 28
  • Maximum: 72
  • Default: 48
{ "style": { "titleSize": 56 } }

Larger title sizes are dramatic and high-impact. Smaller sizes let longer titles fit without overflow. If you need more flexibility, pair a smaller titleSize with /validate to confirm the text fits before rendering.

The font size for the description in pixels.

  • Minimum: 14
  • Maximum: 32
  • Default: 22
{ "style": { "descSize": 18 } }

Controls the horizontal and vertical alignment of the text block within the canvas:

ValueBehavior
leftText left-aligned, positioned in the upper-left quadrant
centerText centered horizontally
bottomText left-aligned, anchored to the bottom of the canvas
{ "style": { "layout": "center" } }

Default: left

The bottom layout is particularly useful with the story format (1080×1920) and background images, placing text in the lower third where it reads naturally against the image.

Six built-in gradient presets control the background color scheme. Each is designed to work well with the default accent color and white text:

NameColorsCharacter
voidNear-black deep purpleDark, dramatic, universal
deep-seaDark teal to navyCool, technical
emberDeep charcoal to warm rustBold, energetic
forestDark green to blackNatural, earthy
plumDeep magenta to dark purpleCreative, distinctive
slateDark blue-grey to charcoalProfessional, neutral
{ "style": { "gradient": "ember" } }

Default: void

All gradients are dark-themed to ensure white text remains legible. If you’re using the blog-hero template with a background image, the gradient is overridden by the image — in that case, control darkness via style.overlayOpacity instead.

When omitted, each field falls back to:

{
"style": {
"accent": "#38ef7d",
"font": "Outfit",
"titleSize": 48,
"descSize": 22,
"layout": "left",
"gradient": "void",
"overlayOpacity": 0.65
}
}
Terminal window
curl -X POST https://og-engine.com/render \
-H "Authorization: Bearer oge_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "og",
"title": "The Pragmatic Engineer",
"description": "Deep dives into software architecture and engineering culture.",
"tag": "Newsletter",
"style": {
"accent": "#f59e0b",
"font": "Playfair Display",
"titleSize": 52,
"descSize": 20,
"layout": "left",
"gradient": "plum"
}
}' \
--output card.png

Experiment with style settings and see changes rendered instantly:

0.0ms|8500x
Accent
Font
Layout
Gradient
48
22