最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Python制作一个视频倒放神器代码示例
时间:2022-06-25 01:23:55 编辑:袖梨 来源:一聚教程网
本篇文章小编给大家分享一下Python制作一个视频倒放神器代码示例,文章代码介绍的很详细,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。
源码如下
from PIL import Image, ImageSequence # 读取 GIF im = Image.open("1.gif") # GIF 图片流的迭代器 iter = ImageSequence.Iterator(im) index = 1 # 遍历图片流的每一帧 for frame in iter: print("image %d: mode %s, size %s" % (index, frame.mode, frame.size)) frame.save("./images/img%d.png" % index) index += 1 # 把 GIF 拆分为图片流 imgs = [frame.copy() for frame in ImageSequence.Iterator(im)] # 图片流反序 imgs.reverse() # 将反序后的所有帧图像保存下来 imgs[0].save("reverse.gif", save_all=True, append_images=imgs[1:])
效果展示
相关文章
- 2025盘点正规虚拟币交易平台前十-最火数字资产交易所币安app推荐 06-16
- 《歧路旅人:大陆的霸者》肥沃土壤快速获取指南 06-16
- 《交错战线》岗岩技能好用吗 06-16
- ChainCatcher 深度参与韩国加密盛会,助力 Web3 生态发展 06-16
- 安全可靠全球交易所加密货币APP排行-最安全现货交易所币安推荐 06-16
- 《斗罗大陆:史莱克学院》伙伴选择有哪些建议 06-16