import imageio
with imageio.get_writer('/path/to/movie.gif', mode='I') as writer:
for filename in filenames:
image = imageio.imread(filename)
writer.append_data(image)
Hi Simon,
The process assumes that the frames are of equal size. I’m even surprised that what you’re doing works :) To do what you want, you can best get the maximum size and pad all images (or at least the first) using this size. Something like this:
ims = [...]
max_shape = [0, 0]
for im in ims:
max_shape[0] = max(max_shape[0], im.shape[0])
max_shape[1] = max(max_shape[1], im.shape[1])
template = np.zeros(max_shape)
for im in ims:
better_im = template.copy()
better_im[:im.shape[0], :im.shape[1]] = im
...
Regards,
Almar
--
You received this message because you are subscribed to the Google Groups "imageio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imageio+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/imageio.
For more options, visit https://groups.google.com/d/optout.