I am trying to save a PIL image to google cloud storage from Datalab.
from PIL import Image
out_image = Image.open( StringIO( gs_buck_obj.read_stream() ) )
# run through cloud vision api and do some stuff
....
my_file = StringIO()
out_image.save(my_file , "PNG")
**This is where I am not sure what to do but have tried next line
gs_buck_obj_out.write_stream(my_file.getvalue(), 'text/plain')