daily pastebin goal
41%
SHARE
TWEET

Untitled

Xlorddx Aug 15th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from PIL import Image
  2.  
  3.  
  4. img = Image.open("56.jpg")
  5.  
  6.  
  7. pixels = img.load()
  8.  
  9.  
  10. for i in range(img.width):
  11.     for j in range(img.height):
  12.        
  13.         r, g, b = pixels[i, j]
  14.         S = (r + g + b) // 3
  15.        
  16.         pixels[i, j] = (S, S, S)
  17.  
  18.  
  19. img.show()
  20.  
  21.  
  22. img.save("14.jpg")
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
 
Top