Skip to Content
Octant

Thumbnails and scripting

Capture static images from Octant share links via the command line for automation and gallery thumbnails.

Desktop Octant can open a share link, wait for the plot to finish rendering, save it to an image file, and exit automatically:

octant --snapshot out.png "https://ndvis.github.io/octant/?src=https://x/a.zarr&var=t2m&plot=heatmap"

Octant waits until all required data chunks, coordinates, and (for zoomed or multiscale views) high-resolution levels have loaded, followed by four seconds of visual stability. All UI panels are automatically hidden during capture.

Command-line options

OptionDescription
--snapshot <file>Output file path. The file extension determines the format: png, jpg, webp, svg, or pdf (SVG and PDF embed the rendered image).
--size WxHExact output dimensions in pixels (for example, 800x450). The plot is scaled to cover the target size and center-cropped. When omitted, the native canvas size is used.
--timeout <seconds>Maximum time to wait before aborting (default: 120 seconds).
--no-colorbarOmit colorbars from the exported image.
--no-axesOmit axes from the exported image.

The share link URL may also be passed before the option flags.

Scripting and exit codes

Exit codeMeaning
0Snapshot saved successfully
1Execution failed (unreadable store, empty plot, or timeout exceeded); the error reason is printed to stderr
2Invalid command-line arguments

Any warnings emitted while loading are also printed, and execution aborts on the first fatal error. Because Octant opens a GPU-backed window to render the capture, a graphical display is required. Total runtime depends on how long the underlying dataset takes to stream.

Gallery thumbnails are 800x450 WebP images that can be created with any tool. For convenience, the tools/thumbnails utility in the docs repository automates thumbnail generation using Octant:

cargo run --release --manifest-path tools/thumbnails/Cargo.toml -- <entry>

For each specified gallery entry, the tool opens the same share link used by its Open in Octant button with --size 800x450 and saves a WebP image (including axes and colorbars) to the path specified by the entry's thumbnail field. Pass --no-colorbar or --no-axes to exclude those elements.

On this page