Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Libs import BMP,PCX
- path = 'SCScrnShot_112515_221707.pcx'
- cycle_ranges = [
- [1,6],
- [7,13]
- ]
- frames = 20
- bmp = BMP.BMP()
- try:
- bmp.load_file(path)
- except:
- pcx = PCX.PCX()
- pcx.load_file(path)
- bmp = BMP.BMP()
- bmp.load_data(pcx.image, pcx.palette)
- for i in range(frames):
- for r in cycle_ranges:
- cycle = bmp.palette[r[0]:r[1]+1]
- cycle.insert(0, cycle.pop())
- bmp.palette[r[0]:r[1]+1] = cycle
- bmp.save_file('cycle%d.bmp' % i)
Advertisement
Add Comment
Please, Sign In to add comment