
# 通过python将图片转成base64编码
下方示例代码以Python为例，介绍如何将d:\\demo.jpg图片转换成base64编码。您也可以使用在线的图片转base64工具。
```
import base64
with open("d:\demo.jpg", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read()).decode()
print(encoded_string)
```
