Render an animation to APNG
riv_render_apngRender a .riv animation or state machine to an animated PNG with 24-bit color and full alpha transparency, producing files that animate in GitHub READMEs like a regular image.
Instructions
Render a .riv animation (or state machine playback) to an animated PNG (APNG). Unlike GIF this supports 24-bit color plus full alpha transparency, and GitHub READMEs animate it like a regular image. Frames are rendered with a transparent background by default.
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": {
"path": "<path>"
},
"name": "riv_render_apng"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | Frames per second (default 20) | |
| out | No | Output path, .apng or .png (default: <name>.apng alongside the .riv) | |
| path | Yes | Path to the .riv file | |
| loops | No | Loop count (0 = infinite, default 0) | |
| width | No | Output width (default 480) | |
| height | No | Output height in px (default: keeps the artboard aspect ratio) | |
| artboard | No | Artboard name (default: first artboard) | |
| duration | No | Seconds to render (default 2) | |
| animation | No | Animation name (default: first state machine or animation) | |
| background | No | CSS background color when transparent=false (default #ffffff) | |
| transparent | No | Render on a transparent background to keep APNG alpha (default true). Set false to composite onto 'background' | |
| stateMachine | No | State machine name (takes precedence over animation) |