Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from parse_tpl import *
- from os import mkdir
- from os.path import exists
- name = "banner"
- width = 96
- height = 32
- if not exists(name):
- mkdir(name)
- with open("%s%sx%s.tpl" % (name, width, height), "rb") as f:
- f.seek(0, 2)
- size = f.tell()
- count = int(float(size) / float(width) / float(height) / 2.0)
- for i in range(count):
- tex = RGB5A3_Texture(width, height)
- f.seek(width * height * 2 * i)
- tex.DecodeImage(f)
- tex.image.save("%s/img%d.png" % (name, i))
Add Comment
Please, Sign In to add comment