with open("1.jpg", "r") as f:
data=f.read()
base64.b64encode(data)#图片转字节
base64.b64decode(data)#字节转图片