Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- image_original = Image.open('kSZzc.png')
- image_gray = image_original.convert("L") # Convert to grayscale image
- image_gray_bw = image_gray.point(lambda pixel: 0 if pixel<128 else 255) # convert to binary image
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement