A plugin for making animations in napari

    View project data

    License PyPI Python Version tests codecov

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

    This napari plugin was generated with Cookiecutter using with @napari's cookiecutter-napari-plugin template.

    It is built off of great work from @guiwitz in naparimovie which was initially submitted to napari in PR#851.


    napari-animation provides a framework for the creation of animations in napari and features:

    • an easy to use GUI for interactive creation of animations
    • Python tools for programmatic creation of animations

    This plugin is currently pre-release and under active development. APIs are likely to change before it's first 0.0.1 release, but feedback and contributions are welcome.


    You can clone this repository with install locally with

    pip install -e .


    Examples can be found in our examples folder. Simple examples for both interactive and headless use of the plugin follow.


    napari-animation can be used interactively by creating an AnimationWidget from a napari Viewer and adding it to the viewer as a dock widget.

    from napari_animation import AnimationWidget
    animation_widget = AnimationWidget(viewer)
    viewer.window.add_dock_widget(animation_widget, area='right')

    AnimationWidget image


    napari-animation can also be run headless, 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)

    Is everything animate-able?

    Unfortunately, not yet! Currently differences in the following objects are tracked by the Animation class

    • Viewer.dims
    • Layer.scale
    • Layer.translate
    • Layer.rotate
    • Layer.shear
    • layer.opacity
    • Layer.blending
    • Layer.visible

    Support for more layer attributes will be added in future releases.


    Contributions are very welcome. Tests and additional infrastructure are being setup.


    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.2

    Release date:

    • 13 May 2021

    First released:

    • 23 April 2021


    • BSD 3-Clause

    Supported data:

    • Information not submitted

    GitHub activity:

    • Stars: 42
    • Forks: 16
    • Issues + PRs: 22

    Python versions supported:

    Operating system:


    • imageio
    • imageio-ffmpeg
    • napari (>=0.4.5)
    • napari-plugin-engine (>=0.1.9)
    • numpy
    • qtpy
    • scipy

    Sign up to receive updates