Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '__main__':
- path = Path(f"{Path(__file__).parent.absolute()}")
- images = path.glob("*.png")
- frames = []
- for image in images:
- img_file = get_processed_image(image)
- img_file.save(image, "PNG")
- frames.append(img_file)
- FRAME_DURATION = 300 # ДЛИТЕЛЬНОСТЬ КАЖДОГО КАДРА В МИЛЛИСЕКУНДАХ
- LAST_FRAME_DURATION = 5000 # ДЛИТЕЛЬНОСТЬ ПОСЛЕДНЕГО КАДРА В МИЛЛИСЕКУНДАХ
- gif_duration = [FRAME_DURATION for i in range(0, len(frames) - 1)] + [LAST_FRAME_DURATION]
- frames[0].save("timelapse.gif", save_all=True, append_images=frames[1:], optimize=False, duration=gif_duration, loop=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement