how can i write a binary array as an image in python?,img.save('/tmp/image.bmp')