render_preview
Render a recipe as a small JPEG preview to verify composition before applying the transform. Optionally overlay guide lines or a mask to inspect alignment and coverage.
Instructions
Render a recipe as a small JPEG preview (long edge <= 768 by default) and return it
inline plus a file path, so the composition can be checked before committing to
apply_transform. Takes either recipe or preset, exactly like apply_transform.
Optional long_edge (256..=1568) sets the preview size: raise it to 1568 when the
point of the preview is to READ text in the image; 768 is too small for that.
Optional overlay ("grid" | "thirds" | "horizon") draws semi-transparent composition
guide lines on the returned preview only (never on the apply_transform output).
overlay="mask" instead visualises a mask: pass mask_revision_id (required for this
overlay and rejected for the others) and the preview is tinted red where the mask
weight exceeds 0.5 and dimmed elsewhere, so the coverage can be eyeballed.
Note: if the recipe's encode format is png, webp, or avif, any ICC color profile
on the source is dropped (embedding is only supported for jpeg output); this is
reported as a warning, not an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preset | No | ビルトインプリセット名。`recipe` とは排他。 | |
| recipe | No | 変換レシピ。`{"operations": [...]}`。`preset` とはどちらか一方のみ指定する。 | |
| overlay | No | 構図確認用のガイド線。`"grid"`(1/8 刻みの格子)| `"thirds"`(三分割法)| `"horizon"`(1/12 刻みの水平線のみ、傾き目視用)| `"mask"`(マスクの被覆可視化。 `mask_revision_id` が必須)。省略時はオーバレイなし。 | |
| long_edge | No | プレビューの長辺(256..=1568)。省略時は 768。 文字を読む用途では 1568 まで上げる(DESIGN.md §9.12)。 | |
| revision_id | Yes | 入力 revision ID("rev_...")。 | |
| mask_revision_id | No | `overlay: "mask"` で可視化するマスク画像 revision ID。 `overlay` が `"mask"` のときのみ指定でき、そのときは必須。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | ||
| height | Yes | ||
| overlay | No | 適用した overlay。未指定なら null。 | |
| warnings | Yes | ||
| byte_size | Yes | ||
| mime_type | Yes | ||
| recipe_hash | Yes | ||
| preview_path | Yes | プレビュー画像の絶対パス。 | |
| engine_version | Yes | ||
| mask_revision_id | No | `overlay: "mask"` で可視化したマスクの revision ID。それ以外では null。 | |
| source_revision_id | Yes |