stitch_gif_animation#

data_morph.plotting.animation.stitch_gif_animation(output_dir: str | Path, start_shape: str, target_shape: str | Shape, frame_numbers: list[int], keep_frames: bool = False, forward_only_animation: bool = False) None[source]#

Stitch frames together into a GIF animation.

Parameters:
  • output_dir (str or pathlib.Path) – The output directory to save the animation to. Note that the frames to stitch together must be in here as well.

  • start_shape (str) – The starting shape.

  • target_shape (str or Shape) – The target shape for the morphing.

  • frame_numbers (list[int]) – The saved frames to use in the GIF. Repeated consecutive frames will be shown as a single frame for a longer duration (i.e., x repeats, means x times longer than the default duration of 5 milliseconds).

  • keep_frames (bool, default False) – Whether to keep the individual frames after creating the animation.

  • forward_only_animation (bool, default False) – Whether to only play the animation in the forward direction rather than animating in both forward and reverse.

See also

PIL.Image

Frames are stitched together with Pillow.