Skip to main content

Morpho

A general-purpose programmatic animation tool

Features

  • Animate basic figures like Points, Paths, Polygons, Splines, Images, and Text
  • Helper functions to build more complex composite figures like grids
  • Tools for quickly creating custom figures that animate in precisely specified ways
  • Support for rendering and animating LaTeX.
    • Requires a LaTeX distribution to be preinstalled, as well as dvisvgm
  • Multiple tweening options and the ability to define custom tweens
  • Apply custom transformations to figures to create complex patterns
  • Support for multiple layers each with its own independent dynamic camera
  • Ability to use layers as masks for other layers
  • Color gradients, both as fills and as color gradients along paths
  • Some primitive 3D animation capability
  • Preview animations along with the ability to locate positions on screen with a click
  • Export animations as MP4, WEBP, GIF, and PNG sequences at arbitrary framerates and resolutions
    • Note: FFmpeg required to create MP4s, Gifsicle required to make small size GIFs, and img2webp required to make WEBPs.

Gallery and Documentation

A gallery of animations made with Morpho is available here. For more, you can also take a look at the YouTube channels Morphocular and Serpentine Integral, which use Morpho to create most of the animations.

Documentation is currently limited, but there are a few guides you can look thru which will help you learn how to use Morpho and get you started making your own animations. Questions are welcome on the Discussions page.

Installation

Morpho is a library for Python and works on Python 3.8 or higher and requires Pycairo to run. For Windows users, Morpho and all its basic dependencies, including Pycairo, should be installable via a simple pip command:

pip3 install morpholib

Installation on other platforms has not been well-tested, unfortunately, and does not appear to be as straightforward. For now, I think the best method is to first see if you can install Pycairo separately (for instructions on how to do so, see this), test that the Pycairo installation is working, and then attempt to install Morpho via the above pip command.

Softer requirements

If you want to export animations as MP4s, small-sized GIFs, or WEBPs, you will need to install FFmpeg for MP4, Gifsicle for GIF, and/or img2webp for WEBP. But if that doesn't matter to you (or if you just want to try out Morpho), you can still preview animations and export them as PNG sequences and large-sized GIFs just using the base installation of Morpho.

Please note that FFmpeg, Gifsicle, and img2webp will need to be added to your PATH environment variable for Morpho to be able to access them by default.

For Morpho to be able to parse LaTeX code, you must have a LaTeX distribution installed along with dvisvgm. But if you're okay with not using Morpho's LaTeX features, this requirement is optional.

SciPy is an optional, but recommended, dependency that is necessary currently for only a few features (flowStreamer and FlowField). SciPy can be installed via pip with the command pip install scipy

Testing the installation

To see if it installed correctly, try running the following Python code:

import morpholib as morpho
morpho.importAll()
morpho.sample.play()

If you see an animation of a morphing grid appear on your screen, congratulations! Morpho should be installed and working properly.

License

This project is licensed under the terms of the MIT license.

Release files for morpholib 0.11.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for morpholib 0.11.0.post1
File Size Uploaded
morpholib-0.11.0.post1.tar.gz 268.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for morpholib 0.11.0.post1
File Interpreter ABI Platform
morpholib-0.11.0.post1-py3-none-any.whl Python 3 none any Details

Total release size: 549.2 kB

Release files / morpholib-0.11.0.post1.tar.gz

Download URL morpholib-0.11.0.post1.tar.gz
Size 268.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f9f3c01a9e6f962073a4650260a8035ae23928533b77816ff3c5ab3843650e2
BLAKE2b-256 checksum
How to use checksums
4afabb3545c5cc623c18fc46d6e2837ab0332e46ff6d854568da514e43b2810f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.1

Release files / morpholib-0.11.0.post1-py3-none-any.whl

Download URL morpholib-0.11.0.post1-py3-none-any.whl
Size 280.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61489d90765a61e748c0c3a273817ec2482c4b1675344027afd0251503598c31
BLAKE2b-256 checksum
How to use checksums
99df05d5d6e17c25cb25e8097062f03e052fabe36e70e804ce4f46d85dcc4d0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.11.0.post1 This release

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page