from PIL import Image
image_file = Image.open('convert_image.png')
image_file = image_file.convert('1')
image_file.save('result.png')
Using python PIL to turn a RGB image into a pure black and white image