1 将图像的字节数组转换为Image对象 image_bytes # 图像字节码 import io from PIL import Image img = Image.open(io.BytesIO(image_bytes)) # io.BytesIO():转换为字节流