📅  最后修改于: 2022-03-11 15:00:17.786000             🧑  作者: Mango
import base64
from io import BytesIO
buffered = BytesIO()
image.save(buffered, format="JPEG")
img_str = base64.b64encode(buffered.getvalue())