📜  将base64转换为图像python代码示例

📅  最后修改于: 2022-03-11 14:47:15.808000             🧑  作者: Mango

代码示例1
import base64
image = open('deer.gif', 'rb')
image_read = image.read()
image_64_encode = base64.encodestring(image_read)
image_64_decode = base64.decodestring(image_64_encode) 
image_result = open('deer_decode.gif', 'wb') # create a writable image and write the decoding result
image_result.write(image_64_decode)