from PIL import Image
import  numpy as np

tulImage = Image.open('WORKSHOP100.png')
tulGSCALE = tulImage.convert('L')
tulBW = tulGSCALE.point(lambda x: 0 if x<160 else 255, '1')
gs = np.asarray(tulGSCALE).copy()
bw = np.asarray(tulBW).copy()
io = []
print(bw)
print(gs)
tulBW.save('result.png')
tulGSCALE.save('result1.png')
rows, cols = bw.shape
