Код: Выделить всё
from PIL import Image
img = Image.open('some/file.png')
img = img.convert(mode='1')
imgbytes = img.tobytes()
with open('filepath', 'w') as file_out:
file_out.write(imgbytes)
Код: Выделить всё
write()Подробнее здесь: https://stackoverflow.com/questions/798 ... -to-a-file
Мобильная версия