Skip to content

textmode.export.js ​

Export finished textmode.js artworks without leaving the sketch.

Choose an output ​

Use canvas capture for the rendered image on screen: PNG, JPEG, WebP, GIF, and video preserve compositing, filters, shaders, and post-processing. Use layer data export when the artwork should stay editable or machine readable: TXT and SVG read from the selected layer, while JSON can describe either the selected layer or the full layer stack.

Start with ExportPlugin, then call the helpers added to your sketch or use the built-in export overlay. For recipes and format trade-offs, read the Exporting guide.

Workflow ​

Install the plugin and use the export helpers added to a textmode.js sketch.

NameDescription
TextmodeExportAPIRuntime export helpers that ExportPlugin attaches to the Textmodifier instance.
ExportPluginDefault export plugin instance for the standard textmode.js workflow.

Canvas capture ​

Export a still image from the rendered canvas.

Type AliasDescription
ImageExportOptionsOptions for exporting the textmode content to image format.

GIF export ​

Capture deterministic frames and encode an animated GIF.

Type AliasDescription
GIFExportOptionsOptions for capturing deterministic textmode frames as an animated GIF.
GIFExportProgressProgress information emitted while deterministic frames are captured and encoded as an animated GIF.

Video export ​

Capture deterministic frames and encode MP4 or WebM video with Mediabunny.

Type AliasDescription
VideoBitrateModeBitrate allocation strategy for the native encoder.
VideoExportFormatVideo container format produced by saveVideo() and toVideoBlob().
VideoExportOptionsOptions for capturing deterministic textmode frames as MP4 or WebM video.
VideoExportPhaseDetailed phase information for progress UIs that distinguish capability probing, frame capture, and output.
VideoExportProgressProgress information emitted while a deterministic video is probed, captured, and written.
VideoHardwareAccelerationWebCodecs hardware acceleration preference.
VideoQualityVideo compression policy passed to Mediabunny.
VideoQualityLevelQualitative video quality level matching Mediabunny's five native levels.
VideoRecordingStateHigh-level lifecycle state reported while a video export is captured, encoded, or completed.
VideoSaveDestinationDestination policy used by saveVideo().

Layer data export ​

Export selected-layer text or vector data as TXT or SVG.

NameDescription
LayerExportOptionsShared option for exporters that read layer framebuffer data.
SVGExportOptionsOptions for exporting the textmode content to SVG format.
TXTExportOptionsOptions for exporting the textmode content to TXT format.

JSON document data ​

Export selected-layer or full-stack document data as JSON.

Type AliasDescription
JSONExportColorModeSupported JSON color output modes.
JSONExportOptionsOptions for exporting the textmode content to JSON format.
JSONExportTargetTarget scope for JSON export.
TextmodeDocumentJSONJSON document exported by the JSON exporter.

Overlay ​

Configure and control the built-in export overlay.

NameDescription
ExportOverlayControllerController for managing the export overlay UI visibility at runtime.
ExportOverlayPositionCurrent canvas-relative placement state for the export overlay UI.
ExportOverlayPositionInputCanvas-relative placement coordinates for the export overlay UI.
ExportDefaultsPer-format default options used to seed the overlay UI inputs at mount time and after a ExportOverlayController.resetDefaults call.
ExportDefaultsPatchPartial patch accepted by ExportOverlayController.setDefaults.
GIFOverlayDefaultsDefault GIF export fields controlled by the export overlay.
ImageOverlayDefaultsDefault image export fields controlled by the export overlay.
JSONOverlayDefaultsDefault JSON export fields controlled by the export overlay.
SVGOverlayDefaultsDefault SVG export fields controlled by the export overlay.
TXTOverlayDefaultsDefault TXT export fields controlled by the export overlay.
VideoOverlayDefaultsDefault video export fields controlled by the export overlay.