Export the current timeline view as a PNG, JPEG, or WebP image.
Returns a Promise<Blob> containing the rendered timeline image. Throws if the timeline has been destroyed.
const blob = await timeline.toImage(options?);
| Property | Type | Default | Description |
|---|---|---|---|
type | string | "image/png" | MIME type — "image/png", "image/jpeg", or "image/webp". |
quality | number | — | Quality for lossy formats (0–1). Ignored for PNG. |
dpr | number | 1 | Device pixel ratio. Use values > 1 for higher resolution exports. |
backgroundColor | string | transparent | Background fill colour (e.g. "#ffffff"). |
dpr: 2 or higher for crisp exports on high-DPI displays or for print.async function downloadTimeline() {
const blob = await timeline.toImage({
type: 'image/png',
dpr: 2,
backgroundColor: '#ffffff'
});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'timeline.png';
a.click();
URL.revokeObjectURL(url);
}