Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save images #1

Closed
tokejuhoklee opened this issue Aug 24, 2020 · 2 comments
Closed

Save images #1

tokejuhoklee opened this issue Aug 24, 2020 · 2 comments

Comments

@tokejuhoklee
Copy link

I've been looking a bit at the code now, and I don't seem to be able to figure out how I could output the final image as an image file. It would be cool to be able to output all the different frames from a full blend into a gif for example. I don't know if you could point me in a direction where I could figure it out self, or if it maybe could be easy to implement for you, but I would really apreciate it

@ddowd97
Copy link
Owner

ddowd97 commented Aug 24, 2020

Hello, thanks for expressing your interest in this repository!
If you want to modify the source code yourself, my current favorite (easy) way of saving an array to an image is with this block:
from PIL import Image
pic = Image.fromarray(array)
pic.save("filename.jpg")

As for generating a GIF from a full blend, this module could be helpful.

I've never tried generating a GIF myself, but this request should be a fairly simple feature for me to implement nonetheless.
Honestly, the hardest part would just be fitting a new button into the GUI. ;) I'll see what I can do tonight or tomorrow.

@ddowd97 ddowd97 pinned this issue Aug 24, 2020
@ddowd97
Copy link
Owner

ddowd97 commented Aug 24, 2020

Following up - I was so interested in this request that I decided to immediately go ahead and get an implementation working.
The repository has now been updated with the capability of saving images and GIFs, so feel free to try out the newest release!

And just for the record, in the case of generating GIFs, I ended up going with this approach:
imageio.mimsave(filepath, imageList, duration=value)
where value is the float value of seconds given to each frame of the GIF.

I did my best to apply every test case possible in such a short time frame, so hopefully there are no bugs!
If you do encounter any issues, please let me know so I can iron them out (chances are I'll discover them as I polish, though).

Thank you for the feature request.

@ddowd97 ddowd97 closed this as completed Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants