Betterflow’s export system is entirely client-side — no files leave your browser unless you choose to download them. Image exports run through a layered compositing pipeline and an optional Sharp API pass for format-specific optimization. Video exports use the best available encoder for the chosen format, with automatic fallback to ensure broad browser compatibility.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/betterspacx/app/llms.txt
Use this file to discover all available pages before exploring further.
Image Export
Static screenshots can be exported as PNG, JPEG, or WebP at up to 5× scale:Format
PNG preserves transparency (useful when the background is set to transparent). JPEG produces smaller files at the cost of the alpha channel. WebP offers the smallest file size with good quality for web use.
Scale (1×–5×)
Export at 1×, 2×, 3×, 4×, or 5× the canvas pixel dimensions. CSS gradients and vector-like elements scale with no quality loss; raster images are upsampled with high-quality bicubic interpolation.
Quality Preset
Choose High, Medium, or Low quality. For JPEG: 85%, 75%, 60% respectively. For WebP: 82%, 72%, 55%. PNG is always lossless regardless of preset.
Copy to Clipboard
The Copy action runs the same compositing pipeline as a normal export but skips the Sharp API pass (skipSharp: true) for speed. The resulting image blob is written directly to the clipboard via the Clipboard API.
Video Export
Betterflow exports animations as MP4, WebM, or GIF by rendering the animation frame-by-frame and passing the frames through the appropriate encoder.Encoder Selection
The encoder is chosen automatically based on the requested format and browser capabilities:- WebCodecs (MP4)
- FFmpeg WASM
- MediaRecorder (WebM)
The preferred encoder for MP4. Uses the browser’s Key-frames are inserted every 2 seconds (
VideoEncoder API, which routes to hardware acceleration on supported platforms (Apple Silicon, modern Intel/AMD GPUs). Produces MP4/H.264 output via mp4-muxer — no server required.frameIndex % (fps * 2) === 0). Backpressure handling yields to the browser if the encoder queue exceeds 8 pending frames.Quality Presets
All encoders share the same three quality tiers:| Preset | Bitrate (MediaRecorder) | CRF (FFmpeg/WebCodecs) | Recommended Use |
|---|---|---|---|
| High | 25 Mbps | 18 | Final delivery, social media uploads |
| Medium | 10 Mbps | 23 | Web embeds, presentations |
| Low | 5 Mbps | 28 | Quick shares, messaging apps |
CRF 18 is considered “visually lossless” for H.264. For GIF exports, quality is controlled by the palette size (fixed at 256 colors) and the Bayer dithering algorithm — the quality preset does not affect GIF output.
Compositing Pipeline
Every export — image or video frame — follows the same multi-step compositing pipeline:Set Playhead (video only)
For each video frame, the playhead is moved to the corresponding timestamp and
getClipInterpolatedProperties computes the animated property values for that moment in time.Capture the Full Canvas
The HTML canvas container (which holds background, image, borders, shadows, and 3D transforms) is captured using
domToCanvas from modern-screenshot. If a 3D transform is active, capture3DTransformWithModernScreenshot is used instead for correct perspective rendering.Apply Blur Regions (post-process)
CSS
backdrop-filter doesn’t render inside domToCanvas. Any active blur regions are applied as a post-processing step directly on the captured canvas using the Canvas 2D filter: blur() API with a clipping path.Sharp Processing (images only)
The composited canvas is sent to the Sharp API for format-specific optimization: lossless PNG compression, JPEG quality control, and correct color profile embedding. Video frames skip this step — FFmpeg handles compression.
IndexedDB Export Storage
All exports are automatically saved locally in IndexedDB under theexports object store:
export-preferences store and restored automatically the next time you open the editor.
Progress Tracking
All export operations emit progress events through theuseExportProgress hook. A progress bar in the export panel updates in real time:
| Stage | Progress Range |
|---|---|
| DOM preparation | 0% → 10% |
| Canvas capture | 10% → 55% |
| Sharp / encoding | 55% → 90% |
| Finalization | 90% → 100% |