Pixel-diff two .riv files
riv_visual_diffCompare two .riv files by rendering the same artboard, animation, and time under identical conditions, then compute a thresholded pixel diff and return match rate, differing pixel count, and diff PNG.
Instructions
Render the same artboard/animation/time from two .riv files under identical conditions (forced to the same output size) and compute a thresholded per-pixel visual diff. Returns match rate, differing pixel count, and a diff visualization PNG (differing pixels in red, matching pixels dimmed).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pathA": "<pathA>",
"pathB": "<pathB>"
},
"name": "riv_visual_diff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Output diff PNG path (default: alongside pathA) | |
| time | No | Seconds to advance before capturing (default 0) | |
| pathA | Yes | Path to the first .riv file | |
| pathB | Yes | Path to the second .riv file | |
| width | No | Output width in px (default: artboard width) | |
| height | No | Output height in px (default: keeps the artboard aspect ratio) | |
| artboard | No | Artboard name (default: first artboard) | |
| animation | No | Animation name; ignored when stateMachine is set (default: the first state machine, else the first animation) | |
| threshold | No | Max per-channel diff (0-255) still counted as a match (default 16) | |
| background | No | CSS background color (default: transparent) | |
| stateMachine | No | State machine name (takes precedence over animation) |