Converting in Python is pretty straightforward, and the key part is using the "base64" module which provides standard data encoding an decoding. Convert Image to String
Here is the code for converting an image to a string.
import base64
with open("t.png", "rb") as imageFile:
str = base64.b64encode(imageFile.read())
print str
Convert String to Image
The following code segment will create an image by using the given string.
fh = open("imageToSave.png", "wb")
fh.write(str.decode('base64'))
fh.close()
Please brief me if had done sometime wrong till now . here is the error trace
'base64' is not a text encoding; use codecs.decode() to handle arbitrary codecs
Thanks for your time.