from time import sleep
# 50Hz
frequency = 20
with save_gif(canvas, "test.gif", frequency=frequency):
for i in range(50):
canvas.clear()
draw(canvas, i * frequency)
canvas.frame()
TODO
[ ] Implement a save_video using OpenCV (as an optional dependency)
[ ] Add docs for this
[ ] Update the docs for saving files: using frame instead of sync_image_data
[ ] Remove docs for sync_image_data and deprecate it? We should probably encourage manual syncing from now on
This PR makes saving frames more reliable (fix https://github.com/martinRenou/ipycanvas/issues/222), allowing to implement a
save_gif
method (fix https://github.com/martinRenou/ipycanvas/issues/136)TODO
save_video
using OpenCV (as an optional dependency)frame
instead ofsync_image_data
sync_image_data
and deprecate it? We should probably encourage manual syncing from now onself.data
when a frame is received