Python PIL & base64

来源:互联网 发布:pdepe 算法 编辑:程序博客网 时间:2024/06/03 06:29

适用pil对图像进行处理后,需要转换成base64

cropImg = img.crop(box)cropImg.save('100.jpg')buffer = cStringIO.StringIO()cropImg.save(buffer, format="JPEG")return base64.b64encode(buffer.getvalue())

原创粉丝点击