Skip to main content

A lightweight napari plugin for recording workflow demonstration videos with live annotations and step markers.

Project description

napari-demo-assistant

napari-demo-assistant records short napari workflow videos with live visual cues, including arrows, numbered step circles, and optional labels.

It is designed for scientific-software demos, user support, GitHub issue feedback, tutorials, and plugin workflows such as napari-sam3-assistant.

Current release: 1.2.0.

The plugin focuses on demo recording, not screenshot capture. Most operating systems already provide screenshot tools. The missing workflow is a simple napari-native way to record what happened and show users where to click.

Key features

  • Record the full napari window or only the viewer canvas.
  • Export MP4 video with H.264 compression.
  • Add arrows, text stamps, and numbered step circles while recording.
  • Use high-contrast annotation color palettes.
  • Attach optional narrative labels to annotations.
  • Use a compact, icon-driven dock widget designed for napari.
  • See drawing state, annotation visibility, napari control state, frame count, and elapsed time at a glance.
  • Right-click or press Esc to exit drawing mode.
  • Keep annotations visible after leaving drawing mode.
  • Undo/redo annotations with buttons or Ctrl+Z / Ctrl+Y.
  • Save timeline step markers beside the video as .steps.json.
  • Optionally log clicked napari/plugin controls as an action trail beside the video.
  • Export YouTube-friendly .srt captions beside the video.
  • Remember the last output path and annotation color palette.

Why this plugin exists

For interactive napari workflows, a short video is often clearer than written instructions. This is especially true for prompting, mask previews, label cleanup, layer switching, and plugin-specific controls.

Written documentation still matters, but UI changes make screenshots and step-by-step text expensive to maintain. A quick recording of the current napari workflow is often the fastest way to help users follow the correct steps.

napari-demo-assistant helps developers, imaging scientists, and support users record clear napari workflow videos with lightweight visual guidance. It is also useful for troubleshooting because users can show exactly what they clicked, what happened, and where an error appeared.

Commercial tools such as Snagit are useful, but they may not be available on Linux, remote workstations, or scientific Python environments. This plugin provides a focused napari-native alternative.

Typical use cases

  • Record short napari workflow tutorials for teaching, onboarding, or plugin documentation.
  • Demonstrate plugin steps, button clicks, layer selection, and mask-cleanup actions.
  • Create video replies for GitHub issues, user support, or collaborator feedback.
  • Let users record bugs, unexpected behavior, or error messages so developers can see exactly what happened.

Installation

From PyPI

pip install napari-demo-assistant

Development install

From the repository root:

pip install -e .

Then start napari:

napari

Open the plugin from:

Plugins > Demo Assistant

Basic workflow

  1. Choose the recording target:
    • Full napari window
    • Viewer canvas only
  2. Choose the output .mp4 path.
  3. Click Start Recording.
  4. Add annotations when needed:
    • Arrow
    • Text
    • Step Circle
  5. Right-click or press Esc to exit drawing mode.
  6. Click Stop to finish recording.

The Add Step Marker workflow is for the recorded video timeline, not for drawing on the viewer. When used during recording, it updates the current step text for the video overlay and saves the step time/frame beside the video as .steps.json.

Annotation behavior

Live annotations can cover the full napari window, including plugin controls. This allows arrows and step markers to point to either the viewer or the user interface.

Drawing mode is intentionally easy to exit:

  • Right-click exits drawing mode.
  • Esc exits drawing mode.
  • Exit exits drawing mode.
  • Existing annotations stay visible.
  • Napari mouse control is restored after drawing mode is off.
  • Clear deletes current annotation marks while keeping the overlay ready.
  • Remove Overlay unloads the overlay itself and restores napari control.

Output notes

The plugin records MP4 video using imageio-ffmpeg, mss, OpenCV, and H.264 compression.

CRF quality controls compression:

  • Lower CRF looks better but creates larger files.
  • Higher CRF creates smaller files with more compression.
  • Example: 23 is higher quality, 28 is the compact default, and 32 is smaller.

A practical default for demos is usually CRF 28 at 12 FPS.

When action logging is enabled, a .actions.json file is saved beside the video. This file records meaningful UI controls clicked during recording, such as buttons, checkboxes, combo boxes, and spin boxes. It is intended as a brief written trail for tutorials, troubleshooting, and GitHub issue feedback. Actions are still logged while recording is paused, using the current time and frame.

When SRT caption export is enabled, a plain UTF-8 .srt file is saved beside the video for YouTube subtitle upload. Captions use manual step markers by default because they are usually cleaner for viewers. The optional Include action clicks in captions setting can add logged control clicks to the captions for troubleshooting videos.

Limitations

  • Intended for napari workflow recording, not general desktop screen capture.
  • Audio recording is not included.
  • Screenshot capture is not a major feature because most operating systems already provide it.
  • Very large windows, high FPS, or low CRF values can produce large video files.

License

This project is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari_demo_assistant-1.2.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_demo_assistant-1.2.0-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file napari_demo_assistant-1.2.0.tar.gz.

File metadata

  • Download URL: napari_demo_assistant-1.2.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for napari_demo_assistant-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7e0ad600516f05b86c461519278a99542fb9ee6b78b67d2423f161b4c9b8e1ec
MD5 1babb940cfddde6d1062a79b5e693aaf
BLAKE2b-256 2204471970073d6ad4b7bb429bab6e5163a80f6726fc83d1741ea1ff540323e6

See more details on using hashes here.

File details

Details for the file napari_demo_assistant-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_demo_assistant-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f40f2ac4f8cf5deb17cb66fe4d0cff23008d9f6477d44472bfc0421fa7ce08e
MD5 fafe825c7323bcc87f692adc958175ff
BLAKE2b-256 1ed4e777a9069862cb5b29a8b01b1ceb4bd6d82d106f23bc9d16d3ae8e856d83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page