Note
Go to the end to download the full example code.
Ease function#
Rendering frames...
0%| | 0/151 [00:00<?, ?it/s]IMAGEIO FFMPEG_WRITER WARNING: input image is not divisible by macro_block_size=16, resizing from (787, 576) to (800, 576) to ensure video compatibility with most codecs and players. To prevent resizing, make your input image divisible by the macro_block_size or set the macro_block_size to 1 (risking incompatibility).
4%|▍ | 6/151 [00:00<00:02, 55.63it/s]
10%|▉ | 15/151 [00:00<00:01, 70.20it/s]
16%|█▌ | 24/151 [00:00<00:01, 75.46it/s]
22%|██▏ | 33/151 [00:00<00:01, 77.26it/s]
28%|██▊ | 42/151 [00:00<00:01, 78.36it/s]
33%|███▎ | 50/151 [00:00<00:01, 77.39it/s]
38%|███▊ | 58/151 [00:00<00:01, 77.24it/s]
44%|████▎ | 66/151 [00:00<00:01, 73.68it/s]
49%|████▉ | 74/151 [00:01<00:01, 69.71it/s]
54%|█████▍ | 82/151 [00:01<00:01, 66.36it/s]
59%|█████▉ | 89/151 [00:01<00:00, 64.20it/s]
64%|██████▎ | 96/151 [00:01<00:00, 65.05it/s]
69%|██████▉ | 104/151 [00:01<00:00, 68.17it/s]
74%|███████▍ | 112/151 [00:01<00:00, 69.82it/s]
79%|███████▉ | 120/151 [00:01<00:00, 69.54it/s]
84%|████████▍ | 127/151 [00:01<00:00, 67.21it/s]
89%|████████▊ | 134/151 [00:01<00:00, 65.71it/s]
93%|█████████▎| 141/151 [00:02<00:00, 65.39it/s]
99%|█████████▊| 149/151 [00:02<00:00, 67.38it/s]
100%|██████████| 151/151 [00:02<00:00, 69.57it/s]
import napari
from skimage import data
from napari_animation import Animation
from napari_animation.easing import Easing
cat = data.cat()
viewer = napari.Viewer()
viewer.add_image(cat, rgb=True)
animation = Animation(viewer)
viewer.camera.zoom = 1
animation.capture_keyframe(steps=0)
animation.capture_keyframe(steps=60)
viewer.camera.zoom = 1.5
animation.capture_keyframe(steps=30, ease=Easing.QUADRATIC)
animation.capture_keyframe(steps=60)
animation.animate("ease_function.mp4", canvas_only=True, fps=60)
Total running time of the script: (0 minutes 3.949 seconds)