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, 54.87it/s]
  9%|▉         | 14/151 [00:00<00:02, 64.15it/s]
 14%|█▍        | 21/151 [00:00<00:01, 66.38it/s]
 19%|█▉        | 29/151 [00:00<00:01, 68.90it/s]
 25%|██▍       | 37/151 [00:00<00:01, 70.30it/s]
 30%|██▉       | 45/151 [00:00<00:01, 70.33it/s]
 35%|███▌      | 53/151 [00:00<00:01, 70.86it/s]
 40%|████      | 61/151 [00:00<00:01, 71.10it/s]
 46%|████▌     | 69/151 [00:00<00:01, 70.53it/s]
 51%|█████     | 77/151 [00:01<00:01, 69.39it/s]
 56%|█████▌    | 84/151 [00:01<00:00, 68.52it/s]
 60%|██████    | 91/151 [00:01<00:00, 67.36it/s]
 65%|██████▍   | 98/151 [00:01<00:00, 67.03it/s]
 70%|██████▉   | 105/151 [00:01<00:00, 66.97it/s]
 74%|███████▍  | 112/151 [00:01<00:00, 65.62it/s]
 79%|███████▉  | 119/151 [00:01<00:00, 64.19it/s]
 83%|████████▎ | 126/151 [00:01<00:00, 61.61it/s]
 88%|████████▊ | 133/151 [00:02<00:00, 59.34it/s]
 92%|█████████▏| 139/151 [00:02<00:00, 59.46it/s]
 97%|█████████▋| 146/151 [00:02<00:00, 61.87it/s]
100%|██████████| 151/151 [00:02<00:00, 65.74it/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.553 seconds)

Gallery generated by Sphinx-Gallery