Python导入图像gi

2024-05-19 19:18:44 发布

您现在位置:Python中文网/ 问答频道 /正文

大家早上好, 我试图导入图像徽标.gif但收到一条错误消息说映像不存在。 感谢你的帮助。 丹尼斯

from PIL import Image, ImageChops
from PIL.GifImagePlugin import getheader, getdata
img = Image.open("logo.gif")
img.show()

from tkinter import *
window = Tk()

imgLbl = Label( window, image = img )


TclError: image "<PIL.GifImagePlugin.GifImageFile image mode=P size=92x95 at 0x8C92B38>" doesn't exist

Tags: from图像imageimport消息imgpil错误