from PIL import Image
I = Image.open('lena.bmp')
I.show()
I = np.array(I)
IMG=[0,0,0,0,0,0,0,0]
for i in range(8):
IMG[i]=I%2
I=I/2
image = Image.fromarray(IMG[i]*255)
image.save(str(i)+'.bmp')
image.show()
支持bmp,tiff,png等格式