Guest User

Untitled

a guest
Nov 25th, 2015
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. from Libs import BMP,PCX
  2.  
  3. path = 'SCScrnShot_112515_221707.pcx'
  4. cycle_ranges = [
  5.     [1,6],
  6.     [7,13]
  7. ]
  8. frames = 20
  9.  
  10. bmp = BMP.BMP()
  11. try:
  12.     bmp.load_file(path)
  13. except:
  14.     pcx = PCX.PCX()
  15.     pcx.load_file(path)
  16.     bmp = BMP.BMP()
  17.     bmp.load_data(pcx.image, pcx.palette)
  18.  
  19. for i in range(frames):
  20.     for r in cycle_ranges:
  21.         cycle = bmp.palette[r[0]:r[1]+1]
  22.         cycle.insert(0, cycle.pop())
  23.         bmp.palette[r[0]:r[1]+1] = cycle
  24.     bmp.save_file('cycle%d.bmp' % i)
Advertisement
Add Comment
Please, Sign In to add comment