SHARE
TWEET

Untitled

a guest Jun 16th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from PIL import Image
  2.  
  3. image_original = Image.open('kSZzc.png')
  4. image_gray = image_original.convert("L") # Convert to grayscale image
  5. image_gray_bw = image_gray.point(lambda pixel: 0 if pixel<128 else 255) # convert to binary image
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top