I am currently doing this for bytestring conversion but I need to convert to string.
img=Image.fromarray(img) output = io.BytesIO() img.save(output, format="png") image_as_string = output.getvalue() img=Image.open(io.BytesIO(image_as_string)) img.save('strimg.png')