A plugin for making animations in napari

License PyPI Python Version tests codecov

napari-animation is a plugin for making animations in napari.

Merlin Lange used napari-animation to create one of Nature's best science images for September 2022

This plugin is built on naparimovie from @guiwitz. naparimovie was submitted to napari in PR#851 before napari plugin infrastructure existed.


napari-animation provides a framework for the creation of animations in napari. The plugin contains:

  • an easy to use GUI for creating animations interactively;
  • a Python package for the programmatic creation of animations.

This plugin remains under development and contributions are very welcome, please open an issue to discuss potential improvements.

You can read the documentation at



napari-animation is available through the Python package index and can be installed using pip.

pip install napari-animation
`napari-animation` uses `ffmpeg` to export animations. If you are using a macOS arm64 computer (Apple Silicon e.g. M1, M2 processor)
the PyPI package does not include the needed binary for your platform. You will need to install `ffmpeg` using
`conda` from the [conda-forge channel]( (`conda install -c conda-forge ffmpeg`)
or using [`homebrew`]( (`brew install ffmpeg`).


napari-animation is also available for install using conda through the conda-forge channel.

conda install -c conda-forge napari-animation


You can clone this repository and install locally with

pip install -e .

Interactive use

napari-animation can be used interactively.

An animation is created by capturing keyframes containing the current viewer state.

To activate the GUI, select napari-animation: wizard from the plugins menu


napari-animation can also be run programatically, allowing for reproducible, scripted creation of animations.

from napari_animation import Animation

animation = Animation(viewer)

viewer.dims.ndisplay = 3 = (0.0, 0.0, 90.0)
animation.capture_keyframe() = 2.4
animation.capture_keyframe() = (-7.0, 15.7, 62.4)
animation.capture_keyframe(steps=60) = (2.0, -24.4, -36.7)
viewer.reset_view() = (0.0, 0.0, 90.0)
animation.animate('', canvas_only=False)


Examples can be found in our Examples gallery, generated from our example scripts. Simple examples for both interactive and headless use of the plugin follow.


Contributions are very welcome and a detailed contributing guide is coming soon. In the meantime, clone this repository and install it in editable mode using pip:

pip install -e .

We recommend using a virtual environment, for example conda.

Ensure you have a suitable Qt backend for napari! We recommend `PyQt5`.
For more information, see the napari [Qt backend installation guide](

To set up your development installation, clone this repository, navigate to the clone folder, and install napari-animation in editable mode using pip.

conda create -n nap-anim python=3.10
conda activate nap-anim
pip install -e ".[dev]" PyQt5

Tests are run with pytest. You can make sure your [dev] installation is working properly by running pytest . from within the repository.

We use [`pre-commit`]( to sort imports and lint with
[`ruff`]( and format code with
[`black`]( automatically prior to each commit.
To minmize test errors when submitting pull requests, please install `pre-commit`
in your environment as follows:

`pre-commit install`


The documentation is available at

The documentation for napari-animation is built with Sphinx and the napari Sphinx Theme.

Building docs locally

After installing the documentation dependencies with

pip install ".[doc]"

you can see a local version of the documentation by running

make docs

Open up the docs/_build/index.html file in your browser, and you'll see the home page of the docs being displayed.

Deploying docs

The napari-animation documentation is automatically built and deployed to the website whenever the main branch is updated, or a new release is tagged. This is controlled by the deploy_docs.yml github actions script.

You can also manually trigger a documenation re-build and deployment from the github actions tab.


Distributed under the terms of the BSD-3 license, napari-animation is free and open source software.


If you encounter any problems, please file an issue along with a detailed description.


  • 0.0.8

Last updated:

  • 16 April 2024

First released:

  • 23 April 2021


  • BSD 3-Clause

Supported data:

  • Information not submitted

Plugin type:

GitHub activity:

  • Stars: 74
  • Forks: 27
  • Issues + PRs: 27

Python versions supported:

Operating system:


  • imageio
  • imageio-ffmpeg
  • napari>=0.4.19rc5
  • npe2
  • numpy
  • qtpy
  • scipy
  • tqdm>=4.56.0
  • superqt