compare_revisions
Compare two image revisions side-by-side, stacked, or as a pixel-difference heatmap to identify visual changes.
Instructions
Scale two revisions to a long edge of 640px each and compose them on one canvas (side by side, or stacked) with an 8px gap, returned inline as a JPEG. A is placed left/top, B is placed right/bottom. Useful for before/after or A/B visual checks. layout="diff" instead requires A and B to share the exact same dimensions and returns a single pixel-difference heatmap plus mean_abs_diff/max_abs_diff/changed_pixel_ratio.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layout | No | `"side_by_side"`(既定、水平に並べる)| `"stacked"`(垂直に並べる)| `"diff"`(並べる代わりに1枚の差分ヒートマップを作る。A/B の寸法が完全一致している必要がある)。 | side_by_side |
| revision_id_a | Yes | 比較対象 A の revision ID("rev_...")。合成画像の左(または上)に置かれる。 | |
| revision_id_b | Yes | 比較対象 B の revision ID("rev_...")。合成画像の右(または下)に置かれる。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes | ||
| width | Yes | 合成画像(比較プレビュー)の寸法・容量。 | |
| height | Yes | ||
| layout | Yes | ||
| byte_size | Yes | ||
| mime_type | Yes | ||
| a_position | Yes | A が合成画像のどこに置かれるか("left" | "top")。 | |
| b_position | Yes | B が合成画像のどこに置かれるか("right" | "bottom")。 | |
| max_abs_diff | No | `layout: "diff"` のときだけ載る: 画素ごとのチャンネル最大絶対差 d の、全画素中の最大値。 | |
| preview_path | Yes | 比較プレビュー画像の絶対パス。 | |
| mean_abs_diff | No | `layout: "diff"` のときだけ載る: 全チャンネル・全画素平均の絶対差(0..255 スケール)。 | |
| changed_pixel_ratio | No | `layout: "diff"` のときだけ載る: d > 2 の画素が全体に占める割合(0.0..=1.0)。 |