Example #1
0
def compress_file(filename):
    image = open(filename, 'rb').read()
    image = transpose_tiles(image)
    pic = compress(image)
    pic = bytearray(pic)
    output_filename = os.path.splitext(filename)[0] + '.pic'
    with open(output_filename, 'wb') as out:
        out.write(pic)
def compress_file(filename):
    image = open(filename, 'rb').read()
    image = transpose_tiles(image)
    pic = compress(image)
    pic = bytearray(pic)
    output_filename = os.path.splitext(filename)[0] + '.pic'
    with open(output_filename, 'wb') as out:
	out.write(pic)
Example #3
0
def decompress_file(filename):
    """
    Decompress a pic given a filename.
    Export the resulting planar 2bpp image to
    """
    pic = open(filename, 'rb')
    image = decompress(pic)
    image = transpose_tiles(image)
    image = bytearray(image)
    output_filename = os.path.splitext(filename)[0] + '.2bpp'
    with open(output_filename, 'wb') as out:
        out.write(image)
def decompress_file(filename):
    """
    Decompress a pic given a filename.
    Export the resulting planar 2bpp image to
    """
    pic = open(filename, 'rb')
    image = decompress(pic)
    image = transpose_tiles(image)
    image = bytearray(image)
    output_filename = os.path.splitext(filename)[0] + '.2bpp'
    with open(output_filename, 'wb') as out:
        out.write(image)