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 (752, 610) to (752, 624) 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.44it/s]
9%|▉ | 14/151 [00:00<00:02, 66.31it/s]
15%|█▍ | 22/151 [00:00<00:01, 69.53it/s]
20%|█▉ | 30/151 [00:00<00:01, 70.29it/s]
25%|██▌ | 38/151 [00:00<00:01, 72.11it/s]
30%|███ | 46/151 [00:00<00:01, 70.48it/s]
36%|███▌ | 54/151 [00:00<00:01, 70.17it/s]
41%|████ | 62/151 [00:00<00:01, 71.42it/s]
46%|████▋ | 70/151 [00:01<00:01, 70.16it/s]
52%|█████▏ | 78/151 [00:01<00:01, 68.97it/s]
56%|█████▋ | 85/151 [00:01<00:00, 68.58it/s]
61%|██████ | 92/151 [00:01<00:00, 66.63it/s]
66%|██████▌ | 99/151 [00:01<00:00, 66.23it/s]
71%|███████ | 107/151 [00:01<00:00, 67.74it/s]
75%|███████▌ | 114/151 [00:01<00:00, 66.38it/s]
80%|████████ | 121/151 [00:01<00:00, 66.20it/s]
85%|████████▍ | 128/151 [00:01<00:00, 66.27it/s]
89%|████████▉ | 135/151 [00:01<00:00, 64.30it/s]
95%|█████████▍| 143/151 [00:02<00:00, 66.34it/s]
100%|██████████| 151/151 [00:02<00:00, 67.90it/s]
100%|██████████| 151/151 [00:02<00:00, 67.92it/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.472 seconds)