export
Converts a Figma node into SVG, PNG, JPG, WebP, or AVIF with scale/quality controls, returning metadata and inline raster images. Create the output directory first.
Instructions
Export a node to SVG, PNG, JPG, WebP or AVIF. Create the output directory first. Returns metadata and, for raster formats, an inline image. PNG suits inline references. For website assets, follow the target project's existing image pipeline; otherwise start with WebP for bitmaps, sized for display dimensions and DPR using scale/maxSize and quality/maxKb. SVG embeds original images and can be large; keep it for vector artwork. scale, quality and maxSize affect raster formats only; maxSize defaults to 1600. Check returned dimensions/bytes and isError; read content on failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | Yes | output path ending in .png, .jpg, .jpeg, .webp, .avif or .svg; create the parent directory first | |
| file | Yes | the saved .fig: a local path (absolute recommended), or gs://bucket/object using gcloud; remote sources are unavailable with --root | |
| node | Yes | a stored node id (12:345 or 12-345), full instance sublayer id (I12:345;67:89) from inspect/nodes, or a Figma URL with ?node-id= | |
| maxKb | No | KiB (1024 bytes) budget; lower lossy quality until it fits; PNG/SVG fail if over budget | |
| scale | No | default 1 | |
| maxSize | No | longest side in pixels, default 1600; 0 keeps the scaled size | |
| quality | No | 1-100, default 80 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| bytes | Yes | ||
| width | Yes | ||
| height | Yes | ||
| quality | Yes | the quality used; --max-kb may lower it |