Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm using
iageio.imwrite()
when using this i keep getting a
ValueError
saying image must be 2D (grayscale, RGB, or RGBA). My input array has a size of 20,125,125. Is this the issue?
imageio.imwrite('patterns.gif',u_e, format = 'GIF-PIL', fps = 100)
–
–
If I understood correctly, you want to create a .gif with 20 frames (first dimension of u_e
), each frame being a 125X125 grayscale image. If that's the case, I would use the mimsave
function instead of imwrite
:
imageio.mimsave('patterns.gif', u_e, format = 'GIF-PIL', fps = 100)
Here's the output:
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.