Render an animation to GIF
riv_render_gifGenerate animated GIF previews from Rive .riv animations or state machine idle states, so you can visually verify your files without opening the Rive editor.
Instructions
Render a .riv animation (or state machine idle playback) to an animated GIF file for preview.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | Frames per second (default 20) | |
| path | Yes | Path to the .riv file | |
| width | No | Output width (default: artboard width, capped 800) | |
| outPath | No | Output GIF path (default: alongside the .riv) | |
| artboard | No | ||
| duration | No | Seconds to render (default 2) | |
| animation | No | Animation name (default: first state machine or animation) | |
| background | No | CSS background color (default white — GIF has no alpha) | |
| stateMachine | No |