Pygame读取pillow图形文件最简代码,

"""
   Pygame读取pillow图形文件最简代码,
   由于要在pygame读取一系列帧,所以需要下面的代码,
   本程序支持jpg,png-24格式,不支持png-8和gif格式,bmp格式没有测试.

   
"""
import pygame
from PIL import Image

cover = "林素婉300.jpg"
im = Image.open(cover)
mode = im.mode
print(mode)
size = im.size
print(size)
im_string = im.tobytes()

You must log in to read the rest of this article. Please log in or register as a user.