a python wrapper for Perfare's Texture2DDecoder
Project description
texture2ddecoder
A python wrapper for Perfare's Texture2DDecoder
Some changes were made to the original code to make it cross-platform compatible.
Installation
pip install texture2ddecoder
or download/clone the git and use
python setup.py install
Example
import texture2ddecoder
# load sample data
data = open("astc_sample", "rb").read()
# decode data
width = 512
height = 512
block_width = block_height = 4
decoded_data= texture2ddecoder.decode_astc(data, width, height, block_width, block_height)
# load raw image data
dec_img = Image.frombytes("RGBA", (width, height), decoded_data, 'raw', ("BGRA"))
Functions
- All functions accept only arguments, no keywords.
- decode_pvrtc can cause segfaults on Mac OS
decode_bc1
decompresses bc1 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_bc3
decompresses bc3 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_pvrtc
decompresses pvrtc textures to BGRA
Params: bytes data, long width, long height, bool is2bpp Return: bytes
decode_etc1
decompresses etc1 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_etc2
decompresses etc2 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_etc2a1
decompresses etc2a1 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_etc2a8
decompresses etc2a8 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_eacr
decompresses eacr textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_eacr_signed
decompresses eacr_signed textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_eacrg
decompresses eacrg textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_eacrg_signed
decompresses eacrg_signed textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_bc4
decompresses bc4 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_bc5
decompresses bc5 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_bc6
decompresses bc6 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_bc7
decompresses bc7 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_atc_rgb4
decompresses atc_rgb4 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_atc_rgba8
decompresses atc_rgba8 textures to BGRA
Params: bytes data, long width, long height Return: bytes
decode_astc
decompresses astc textures to BGRA
Params: bytes data, long width, long height, int block_width, int block_height Return: bytes
unpack_crunch
decompresses crunch textures to BGRA
Params: bytes data Return: bytes
unpack_unity_crunch
decompresses unity_crunch textures to BGRA
Params: bytes data Return: bytes
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for texture2ddecoder-1.0.3-py3.10-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a1d4d356cb6ed21addf6ecb83fa057c34efa022a12d3d166036d90a747142b0 |
|
MD5 | 66f096fbe32491b3e1406d66577768b6 |
|
BLAKE2b-256 | 3cad3a72c858af7b22e37bb8d731a9ae4ebec636afbf3f1549f07bc61ee4d8b0 |
Hashes for texture2ddecoder-1.0.3-py3.10-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e9feb7e86e169a306883631af2cef160174ee1754c2d0f49f1f3701e5d1d00 |
|
MD5 | 11396b6a9805f4265eedb2ca377d2bff |
|
BLAKE2b-256 | 1d2614bdbf7859e29f1b5192be03e368f9aaf5569196a34d17c7a4eff06f9bd3 |
Hashes for texture2ddecoder-1.0.3-py3.10-macosx-10.15-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54f23bd7c5b1c6fed47866af23232f2bcc9635d0bde21e7f9fb632a1ff1b0e7e |
|
MD5 | a5a3ed79759f93af54eb8a8031b80857 |
|
BLAKE2b-256 | 9bbd6ebfa6e2d8ca5e23cedc3e2bae5452590f9923aaa556f59a79c55fad82b0 |
Hashes for texture2ddecoder-1.0.3-py3.9-macosx-10.15-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7355d5ca8d6dd773e902bc844fd54fd0295d10a20a4646e320275addff0e482 |
|
MD5 | 2a985a7030f3c988dcc84f06212c5ac4 |
|
BLAKE2b-256 | 65896d49d6d1315006cd2289964e95be28f165da8bce12dd747577e4f10aa005 |
Hashes for texture2ddecoder-1.0.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db37f02cd8c0c62285ec7b14a897f54679a8458b66e856737f497e9b9cb33ab6 |
|
MD5 | 7f9757798eb37f81ae4412a925c79bfc |
|
BLAKE2b-256 | f6a675f1f9b47ab7b627467d435459674e29610ec81241a90769a643c8082ae1 |
Hashes for texture2ddecoder-1.0.3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc26882d22a7b60abe8dfad384898b70b40144454a0f195bf27711848445e868 |
|
MD5 | 723c7d0d7e6628f3921ac7b0569aa086 |
|
BLAKE2b-256 | 21d6f95ff032721ee8c1315262c1d108cacd7dfd13d8f9158097a9d0c46f4ab3 |
Hashes for texture2ddecoder-1.0.3-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78c3642fbe946c2beedd04b8cb2f456302b84c02bc2f3c3dc91353e29dc93302 |
|
MD5 | 88317e039201671f35ef85d034947a60 |
|
BLAKE2b-256 | 8c2c9b79a5de26b987886de518d74668819a01844531d0f54695134cf7efa1d2 |
Hashes for texture2ddecoder-1.0.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f11894244083e8c7d07c37720df052e32569b01583f15462aa0da80b6a668fc9 |
|
MD5 | e8818becce94ce26ea6960640e2b8abc |
|
BLAKE2b-256 | 370be80983277ae78cd2f6cf46c3a1e55ae71981fe3c3739aedc933cebcb50af |