3

In Jupyter Notebook, you can have an image from a Numpy array and show it without having to save it, like so:

from PIL import Image
import numpy as np

array = np.zeroes((100,100))
img = Image.fromarray(array)
img.show()

Is it possible to do the same with a GIF, without having to write to a file? Assuming I already have a list of images I want to show as a GIF within the notebook. Something like this:

list_of_images # assume it's loaded beforehand
gif_img = to_gif(list_of_images)
gif_img.show()
  • Does this answer your question? [How do I embed a gif in Jupyter notebook?](https://stackoverflow.com/questions/51527868/how-do-i-embed-a-gif-in-jupyter-notebook) – ksohan Feb 15 '22 at 12:49
  • 1
    @ksohan That would require either an already existing GIF or for me to save my GIF to file so no. What I want is to be able to display a GIF generated in code without having to save it. – Sina Mantala Feb 16 '22 at 05:21

0 Answers0