SHARE
TWEET

Untitled

mage_1868 Jul 19th, 2014 (edited) 137 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # coding: utf8
  2. import Image
  3.  
  4. if __name__ == '__main__':
  5.     im = Image.open('afterimage.gif')
  6.    
  7.     try:
  8.         while True:
  9.             im.save('afterimage/afterimage_' + str(im.tell()) + '.gif')
  10.             im.seek(im.tell() + 1)
  11.     except EOFError:
  12.         pass
  13.    
  14.     new = Image.new('RGB', (164, 164), 'white')
  15.    
  16.     for i in xrange(49):
  17.         im = Image.open('afterimage/afterimage_' + str(i) + '.gif')
  18.    
  19.         for x in xrange(164):
  20.             for y in xrange(164):
  21.                 pixel = im.getpixel((x, y))
  22.    
  23.                 if pixel != 0:
  24.                     new.putpixel((x, y), (0, 0, 0))
  25.    
  26.     new.save('afterimage_result.gif')
RAW Paste Data
Top