python 显示gif图像
生活随笔
收集整理的這篇文章主要介紹了
python 显示gif图像
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
from PIL import Image, ImageSequence
import cv2
import numpypic_name = "ani.gif"
im = Image.open(pic_name)for frame in ImageSequence.Iterator(im): #使用迭代器frame = frame.convert('RGB')cv2_frame = numpy.array(frame)show_frame = cv2.cvtColor(cv2_frame, cv2.COLOR_RGB2BGR)cv2.imshow(pic_name, show_frame)cv2.waitKey(10)
?
總結
以上是生活随笔為你收集整理的python 显示gif图像的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: face-swap.zip百度网盘下载
- 下一篇: Android Studio 的安装笔记