SHARE
TWEET

Untitled

a guest May 8th, 2016 35 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from PIL import Image
  2.  
  3. im = Image.open('116GR.png')
  4. pix = im.load()
  5.  
  6. w, h = im.size
  7.  
  8. for x in xrange(w):
  9.     for y in xrange(h):
  10.         rgb = list(pix[x,y])
  11.  
  12.         for k in xrange(3):
  13.             rgb[k] = (rgb[k]&3) * (255/4)
  14.  
  15.         pix[x,y]=tuple(rgb)
  16.  
  17. im.save('out.png')
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