When saving an animated GIF from a Numpy array of shape (20, 64, 64, 3)
and loading it again, the shape is suddenly (20, 64, 64)
. I think the array may contain indices into a color palette but I'm not sure how to access that. How can I restore the original data from the saved GIF?
import imageio
import numpy as np
imageio.mimsave('animation.gif', np.zeros((20, 64, 64, 3)))
np.array(imageio.mimread('animation.gif')).shape # (20, 64, 64)