Guest User

Untitled

a guest
Mar 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. from parse_tpl import *
  2. from os import mkdir
  3. from os.path import exists
  4.  
  5. name = "banner"
  6. width = 96
  7. height = 32
  8.  
  9. if not exists(name):
  10. mkdir(name)
  11.  
  12. with open("%s%sx%s.tpl" % (name, width, height), "rb") as f:
  13. f.seek(0, 2)
  14. size = f.tell()
  15. count = int(float(size) / float(width) / float(height) / 2.0)
  16. for i in range(count):
  17. tex = RGB5A3_Texture(width, height)
  18. f.seek(width * height * 2 * i)
  19. tex.DecodeImage(f)
  20. tex.image.save("%s/img%d.png" % (name, i))
Add Comment
Please, Sign In to add comment