Pillow-ImageSequence模块 图像序列处理
发布日期:2021-07-01 05:57:55
浏览次数:3
分类:技术文章
本文共 839 字,大约阅读时间需要 2 分钟。
读取图片序列 seek、tell
from PIL import Imageimage = Image.open('./images/capf.gif')index=1try: while 1: image.seek(image.tell()+1) print('图像读取第'+str(index)+'帧') image.save('./images/capf_gif/帧'+str(index)+'.png') index=index+1except EOFError: print('图像读取完毕!')
图像读取第1帧图像读取第2帧图像读取第3帧图像读取第4帧图像读取第5帧图像读取第6帧图像读取第7帧图像读取第8帧图像读取第9帧图像读取第10帧图像读取第11帧图像读取第12帧图像读取完毕!
迭代器读取 ImageSequence模块
from PIL import ImageSequencefor frame in ImageSequence.Iterator(image): print(frame.format,frame.size,frame.mode,frame.getbands())
GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)GIF (500, 296) P ('P',)
转载地址:https://pandora.blog.csdn.net/article/details/104085053 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
逛到本站,mark一下
[***.202.152.39]2024年04月28日 20时43分03秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
一致性 hash
2019-05-08
红黑树
2019-05-08
二叉树
2019-05-08
stl 容器比较
2019-05-08
深入分析 Linux 内核链表
2019-05-08
小根堆
2019-05-08
红黑树与小根堆性能对比
2019-05-08
socketpair
2019-05-08
linux 系统调用
2019-05-08
linux-多线程
2019-05-08
linux-多线程--面试题
2019-05-08
posix thread
2019-05-08
多线程执行顺序
2019-05-08
gdb
2019-05-08
C++类型转换
2019-05-08
pthread_cond_wait 和 pthread_cond_signal
2019-05-08
pthread_cond_wait while循环
2019-05-08
Linux下利用Valgrind工具进行内存泄露检测和性能分析
2019-05-08
网络中进程之间如何通信
2019-05-08
常见网络攻击基本原理
2019-05-08