Image Export

Export the current timeline view as a PNG, JPEG, or WebP image.

The exported image captures the current view exactly as rendered, including any visible bands, selection outlines, and dependency connectors.

toImage(options?)

Returns a Promise<Blob> containing the rendered timeline image. Throws if the timeline has been destroyed.

const blob = await timeline.toImage(options?);

ImageGenerationOptions

PropertyTypeDefaultDescription
typestring"image/png"MIME type — "image/png", "image/jpeg", or "image/webp".
qualitynumberQuality for lossy formats (0–1). Ignored for PNG.
dprnumber1Device pixel ratio. Use values > 1 for higher resolution exports.
backgroundColorstringtransparentBackground fill colour (e.g. "#ffffff").
Use dpr: 2 or higher for crisp exports on high-DPI displays or for print.
The minimap and scrollbar are automatically hidden during export. The exported image contains only the timeline content.

Example — Download as PNG

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);
}