https://github.com/hearthsim/decrunch
Python wrapper around Crunch DXTc decompressor
https://github.com/hearthsim/decrunch
crunch dxtc python
Last synced: about 1 year ago
JSON representation
Python wrapper around Crunch DXTc decompressor
- Host: GitHub
- URL: https://github.com/hearthsim/decrunch
- Owner: HearthSim
- License: zlib
- Created: 2017-03-05T22:19:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-09-27T08:27:21.000Z (over 4 years ago)
- Last Synced: 2024-10-06T20:48:30.910Z (over 1 year ago)
- Topics: crunch, dxtc, python
- Language: C++
- Homepage: https://hearthsim.info
- Size: 139 KB
- Stars: 14
- Watchers: 5
- Forks: 23
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# decrunch
[](https://travis-ci.org/HearthSim/decrunch)
decrunch is a Python wrapper around [crunch's](https://github.com/BinomialLLC/crunch) decompressor.
## Setup
- To install directly from PyPI: `pip install decrunch`
- To install from source: `pip install Cython`, then `./setup.py install`
## Usage
```py
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](https://github.com/python-pillow/Pillow) as `bcn`.
## License
The full license text is available in the `LICENSE` file.
See crunch/license.txt for the license of files in the `crunch/` subdirectory.
The files in `crunch/` are an unaltered subset of the original code; the
entirety of crunch may be obtained at .