相关文章推荐
酒量大的充电器  ·  Controller action ...·  3 周前    · 
酒量大的充电器  ·  如何将 LINQ ...·  2 月前    · 
酒量大的充电器  ·  标注属性面板·  5 月前    · 
酒量大的充电器  ·  XML 与 HTML 对比 - ...·  8 月前    · 
酒量大的充电器  ·  Problem in login with ...·  9 月前    · 
威武的香瓜  ·  [转]Entity Framework ...·  2 小时前    · 
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)
                Can you explain what is u_e? Is it a collection of 20 images? Is it  a single image with 20 color channels? I'm a bit confused
– Andrea
                Dec 12, 2019 at 16:33
                I'll link you the full code you will see what i mean better that way. uk.answers.yahoo.com/question/index?qid=20191212155033AAZMVui
– Sam Crowther
                Dec 12, 2019 at 16:40

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.

 
推荐文章