render_template
Compile a layout of text, image, and rect slots at a given canvas size into one imagor URL, with text fitted to boxes and placeholders filled.
Instructions
Render a layout at a given canvas size. Geometry is written the way imagor writes it, so slots can be positioned and sized relative to the canvas with full and full-N, and one template then serves several sizes. A text slot given a height is fitted with fit_text against the box its geometry resolves to, because a font size is absolute and would otherwise be relatively smaller on a larger canvas. Values fill {{placeholders}}. Returns the path, the URL, and what each slot resolved to. Verify it before handing it over - imagor answers 200 with the image unchanged when a filter does not apply, so a render that reports success is not a render that is right. For one image with typed parameters and no layout, use build_imagor_url.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slots | Yes | the elements, applied in order, so later slots draw over earlier ones | |
| values | No | values for {{placeholders}} in slot text and image fields | |
| background | No | canvas background, for example color:1a1a2e; defaults to color:white | |
| canvas_width | Yes | canvas width in pixels | |
| canvas_height | Yes | canvas height in pixels |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| mode | Yes | ||
| note | No | ||
| path | Yes | ||
| signed | Yes | ||
| resolved | Yes | ||
| absolute_url | No |