Skip to content

Commit

Permalink
update GIF function
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzaali committed Jul 4, 2023
1 parent faab512 commit 5df078a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion piscat/GUI/Visualization/image_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def call_save(self):
file_name=file_name,
data=self.save_video,
jump=self.frame_strides,
fps=self.fps,
duration=1000/self.fps,
)

@Slot()
Expand Down
6 changes: 3 additions & 3 deletions piscat/InputOutput/write_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def write_binary(dir_path, file_name, data, type="original"):
return save_path_


def write_MP4(dir_path, file_name, data, jump=0, fps=10):
def write_MP4(dir_path, file_name, data, jump=0, fps=100):
"""
This function writes video as a MP4.
Expand Down Expand Up @@ -97,7 +97,7 @@ def write_MP4(dir_path, file_name, data, jump=0, fps=10):
return save_path_


def write_GIF(dir_path, file_name, data, jump=0, fps=10):
def write_GIF(dir_path, file_name, data, jump=0, duration=100):
"""
This function writes video as a GIF.
Expand Down Expand Up @@ -138,5 +138,5 @@ def write_GIF(dir_path, file_name, data, jump=0, fps=10):
for frame_number in tqdm(range(0, data.shape[0] - jump, jump)):
image_.append(data[frame_number, ...])

imageio.mimsave(save_path, image_, format="GIF", fps=fps)
imageio.mimsave(save_path, image_, format="GIF", duration=duration)
return save_path_

0 comments on commit 5df078a

Please sign in to comment.