img = Image.new('RGB', (img1_size[0], img1_size[1]), 'white')
cmap = {(1): (255, 255, 255), (0): (0, 0, 0)}
data = [cmap[i] for i in img1_k]
img.putdata(data)
img.show()
img.save('Image2.png')
Making an image from the list