# mtexdec.py # Decode Mtex images as used by Sora no Woto. # Usage: mtexdec.py [] # Requires the Python Imaging Library. # Copyright (C) 2013 Shiz, C_U. # Released under the terms of the WTFPL: see http://www.wtfpl.net/txt/copying/ for details. import sys import os import struct import PIL.Image MAGIC = 0x7865744D COLORMAPSIZE = 0x400 def mtex_to_image(source, dest=None, format='GIF'): with open(source, 'rb') as f: magic = struct.unpack(' 3 else 'GIF')