Skip to content

skogler/decrunch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

decrunch

Build Status

decrunch is a Python wrapper around crunch's decompressor.

Setup

  • To install directly from PyPI: pip install decrunch
  • To install from source: pip install Cython, then ./setup.py install

Usage

import decrunch

with open("example.crn", "rb") as f:
	buf = f.read()

fi = decrunch.File(buf)
tex_info = fi.info()

for level in range(tex_info["levels"]):
	print("Level info %i: %r" % (level, fi.info(level)))

with open("out.bc1", "wb") as f:
	f.write(fi.decode_level(0))

Further image decoding requires a DXTn decompressor, such as the one that can be found in Pillow as bcn.

About

Python wrapper around Crunch DXTc decompressor

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 96.7%
  • Python 3.3%