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

Question: animated gifs #79

Open
haesleinhuepf opened this issue Oct 7, 2024 · 1 comment
Open

Question: animated gifs #79

haesleinhuepf opened this issue Oct 7, 2024 · 1 comment

Comments

@haesleinhuepf
Copy link
Owner

I have a 2d+t timelapse dataset as numpy array. I would like to save it as animated gif to disk. Can stackview do this? If yes, how?

git-bob comment

Copy link

github-actions bot commented Oct 7, 2024

This message was generated by git-bob (version: 0.6.4, model: gpt-4o-2024-08-06, Run details), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

Certainly! Stackview can help you save your 2D+t timelapse dataset as an animated GIF to disk. You can use the stackview.animate function for this purpose. Here's a code snippet that demonstrates how to achieve this:

import stackview
import numpy as np

# Assuming 'timelapse_data' is your 2D+t timelapse dataset
timelapse_data = np.array(...)  # Your numpy array data

# Save the animation as a GIF
stackview.animate(timelapse_data, filename="timelapse_animation.gif", frame_delay_ms=100)

This code will take your timelapse data and save it as an animated GIF named timelapse_animation.gif with a frame delay of 100ms between frames. Adjust the frame_delay_ms as needed to control the speed of the animation.

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

1 participant