a texture decompression C++-extension for Python
Project description
tex2img
A texture decompression C++-extension for Python.
Installation
pip install tex2img
or download/clone the git and use
python setup.py install
Notes
- etcpack causes a segfault on linux systems, so linux systems will use basisu under the hood for etc instead
Functions
All functions accept only args and aren't able to handle kwards atm.
basisu_decompress
Decompresses data to RGBA via basisu's unpack_block function.
Args: (compressed data: bytes, width: int, height: int, format: int)
Returns: bytes
Formats:
Format | Mode | Note |
---|---|---|
0 | cETC1 | ETC1 |
1 | cETC1S | ETC1(subset:diff colors only, no subblocks) |
2 | cETC2_RGB | ETC2 color block |
3 | cETC2_RGBA | ETC2 alpha block followed by ETC2 color block |
4 | cETC2_ALPHA | ETC2 EAC alpha block |
5 | cBC1 | DXT1 |
6 | cBC3 | DXT5(DXT5A block followed by a DXT1 block) |
7 | cBC4 | DXT5A |
8 | cBC5 | 3DC / DXN(two DXT5A blocks) |
9 | cBC7 | |
10 | cASTC4x4 | |
11 | cPVRTC1_4_RGB | |
12 | cPVRTC1_4_RGBA | |
13 | cATC_RGB | |
14 | cATC_RGBA_INTERPOLATED_ALPHA | |
15 | cFXT1_RGB | |
16 | cPVRTC2_4_RGBA | |
17 | cETC2_R11_EAC | |
18 | cETC2_RG11_EAC |
decompress_astc
Decompresses raw astc-compressed data to RGBA.
Args: (compressed data: bytes, image width: int, image height: int, block_width: int, block_height: int, isSRGB: False)
Returns: bytes
decompress_atc
Decompresses raw atc-compressed data to RGB(A).
Args: (compressed data: bytes, width: int, height: int, alpha: bool)
Returns: bytes
alpha = False for ATC_RGB alpha = True for ATC_RGBA
decompress_pvrtc
Decompresses raw pvrtc-compressed data to RGBA.
Args: (compressed data: bytes, width: int, height: int, do2bit_mode: 0)
Returns: bytes
decompress_etc
Decompresses raw etc-compressed data to RGB(A).
Args: (compressed data: bytes, width: int, height: int, format: int)
This function has a memory leak, so it might crash if you use it on too many images at once (~500+). The basisu_decompress function also supports the most common ETC formats, so it is a good alternative.
Formats:
Format | Mode |
---|---|
0 | ETC1_RGB_NO_MIPMAPS |
1 | ETC2PACKAGE_RGB_NO_MIPMAPS |
2 | ETC2PACKAGE_RGBA_NO_MIPMAPS_OLD |
3 | ETC2PACKAGE_RGBA_NO_MIPMAPS |
4 | ETC2PACKAGE_RGBA1_NO_MIPMAPS |
5 | ETC2PACKAGE_R_NO_MIPMAPS |
6 | ETC2PACKAGE_RG_NO_MIPMAPS |
7 | ETC2PACKAGE_R_SIGNED_NO_MIPMAPS |
8 | ETC2PACKAGE_RG_SIGNED_NO_MIPMAPS |
9 | ETC2PACKAGE_sRGB_NO_MIPMAPS |
10 | ETC2PACKAGE_sRGBA_NO_MIPMAPS |
11 | ETC2PACKAGE_sRGBA1_NO_MIPMAPS |
crunch_get_texture_info
Retrieves texture information from the CRN file.
Args: (data: bytes)
Returns: dict
crunch_get_level_info
Retrieves mipmap level specific information from the CRN file.
Args: (data: bytes, mipmap_leve: int)
Returns: dict
crunch_unpack_level
Transcodes the specified mipmap level to a destination buffer.
Args: (data: bytes, mipmap_level: int)
Returns: bytes
Sources
ATC & ASTC
The complete BinomialLLC/basis_universal is used and supported. It's default for the ATC and ASTC decompression.
ETC
The whole source of Ericsson/ETCPACK is used for the ETC decompression.
PVRTC
PVRTDecompress.cpp and PVRTDecompress.h of powervr-graphics/Native_SDK are used for the PVRTC decompression.
crunch
A mixed version of BinomialLLC/crunch and Unity-Technologies/crunch is used.
The Unity fork doesn't yield correct results for the original modes, so the BiomialLLC version is used for all modes besides ETC, which was created byUnity.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file tex2img-0.9.1.tar.gz
.
File metadata
- Download URL: tex2img-0.9.1.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 564f5e99662c87d74d911af7a76d50ea7ff69e0c560256eec51befd70748f428 |
|
MD5 | 30ce78cd98e1c4309a664b7a322461fb |
|
BLAKE2b-256 | 1a57dfe6ace04ad17f8d0aa8a949b7fb5aa8fcc5df2e8f653621aa78de7328d7 |
File details
Details for the file tex2img-0.9.1-py3.8-win-amd64.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.8-win-amd64.egg
- Upload date:
- Size: 431.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c38ea196d644f7b4fcf7823695c27563665ede6ba8e1afb99a2eedcc0c006de |
|
MD5 | 333471a6f10a42c80266f16fd13c3d07 |
|
BLAKE2b-256 | 85643bdeaafdb95dfc3cb94557c6792309908b2686cec9178bb9b20381d10dec |
File details
Details for the file tex2img-0.9.1-py3.8-win32.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.8-win32.egg
- Upload date:
- Size: 406.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a994cde306df0b8a5b5ef53b8f0266d35de3bfd160d66adc02b46ca7c9cd77c |
|
MD5 | 42b84dd570e8f45774e964237995d2cb |
|
BLAKE2b-256 | b91186deba87eda41eabad8b7e985e19e80a136e6f750ecaf3b064609a88dd79 |
File details
Details for the file tex2img-0.9.1-py3.8-macosx-10.14-x86_64.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.8-macosx-10.14-x86_64.egg
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcee2c5921b991a4b8e927a9f9dd42f4251adba123f88b1323eb39c068c9d3d9 |
|
MD5 | c5fa44b9e87472303c0f4ccf7aa92665 |
|
BLAKE2b-256 | 8611348229eec51d3e1a9a1a509d2da41aac77064ca8f669da2613e4c184c857 |
File details
Details for the file tex2img-0.9.1-py3.7-win-amd64.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.7-win-amd64.egg
- Upload date:
- Size: 431.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f59a7cb833634c5ecaa2ca07bd2c986659c0e9b1d68152d9ebd7d7d208d29f51 |
|
MD5 | 083c0eb0d82282e59e3ce50ca12410f7 |
|
BLAKE2b-256 | 3103970affb62da27bbabe7212162feaceebc956d1852428a861189345722ef7 |
File details
Details for the file tex2img-0.9.1-py3.7-win32.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.7-win32.egg
- Upload date:
- Size: 406.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41c87415cb53c15d0398a287c38da1868cba3ad1f85b31589c2fe91607f184bc |
|
MD5 | 9a64028710e1e0d9b14edeb9f3f9b3f6 |
|
BLAKE2b-256 | 10356b8f04455ab2e3ba659a380a753dbabce9e5d012963d4393f6e7c625f01d |
File details
Details for the file tex2img-0.9.1-py3.7-macosx-10.14-x86_64.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.7-macosx-10.14-x86_64.egg
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 045ededa9cc67da04991cbf52224b58a318421e64a6053c1a02a05bcdf5b3dc4 |
|
MD5 | 2a1aa923e4becec5ff08e7e0e0db5fad |
|
BLAKE2b-256 | 9d347503aabed8b4806443f9bc0cf4feb46c820b5ca9e5c9e2679281bb1c03c1 |
File details
Details for the file tex2img-0.9.1-py3.6-win-amd64.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.6-win-amd64.egg
- Upload date:
- Size: 431.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5f447f87a05c7b4b80afdb419430da5b2d4aa42df0f0da2f0c2d574ea021e33 |
|
MD5 | a46dc06d72e34d3f81957b9c34f0e046 |
|
BLAKE2b-256 | 073eeb65bb55f3b7662185d27b1c78f621a768b75775c5e8cbd1b17407d6879e |
File details
Details for the file tex2img-0.9.1-py3.6-win32.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.6-win32.egg
- Upload date:
- Size: 406.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2831423ffcff65dab9b179564e99d2fc038bb364ea63e2c2d921408890a484a7 |
|
MD5 | 3fbd0e8ed7e9e20afb7bb25d99915b00 |
|
BLAKE2b-256 | 10145f135aacf0324764a6292f25bb17b497fb5278bca43a9573722e7f2c0676 |
File details
Details for the file tex2img-0.9.1-py3.6-macosx-10.14-x86_64.egg
.
File metadata
- Download URL: tex2img-0.9.1-py3.6-macosx-10.14-x86_64.egg
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a929d3e01c119bb8d5a603a7e683d2f99cd9205824b1ef421a197a863fb7b6d |
|
MD5 | b34b59a6134947a2acc2ae95f3422958 |
|
BLAKE2b-256 | c75172b2654b6d3441a8006aa5c7292c0e92ac2382d6a36ab87102ef2868265f |
File details
Details for the file tex2img-0.9.1-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 430.7 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47ff05caac75e13af609f28a572fc5f5372fcd2d85a0d9152cacaa2882831c2f |
|
MD5 | 87a89843df90367f37c8f0c26a32d8d4 |
|
BLAKE2b-256 | c5d6af05cfca6446e2ceb7eee71cbe517e364540336ea46604d5a684880c9173 |
File details
Details for the file tex2img-0.9.1-cp38-cp38-win32.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp38-cp38-win32.whl
- Upload date:
- Size: 406.1 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a074bd95b8970c8bc96c5d943c90f4aadaa63609cd2297f67863ba2ce7699309 |
|
MD5 | 41f054a68075559f2a7dcfd9371f77ed |
|
BLAKE2b-256 | 9001856cf5cf2971670d0a70fa8f2eeab319bfd83e0e1c15bc2c0c968db3fe7f |
File details
Details for the file tex2img-0.9.1-cp38-cp38-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp38-cp38-macosx_10_14_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc53e62e5442ed2272827838c6c5d77df6882fc4b0c4ba7dc729a65ffdfb67d1 |
|
MD5 | 3ad903bb8ce9898f1ed935fba51b97b4 |
|
BLAKE2b-256 | 25c2544896da9ba70d8c0db563131b2d3bd4a85498ab17702c7d7168d581cce9 |
File details
Details for the file tex2img-0.9.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 430.6 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29cf15dc59b6b989e970ab7a55596412fa12522f6d8aba654eab025eb1b36888 |
|
MD5 | c6fb620965db631d6ace86b8abd9ae60 |
|
BLAKE2b-256 | 36bf234759649f0255834126801cd5bd3dbbe7111840979744eb089f0375ad46 |
File details
Details for the file tex2img-0.9.1-cp37-cp37m-win32.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp37-cp37m-win32.whl
- Upload date:
- Size: 406.1 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4274f93e586474e83e721b37d5d2e4cf46f1591f8f197db0ff2fa97ba62537d0 |
|
MD5 | 81233117e35a21f235d24afce79ab824 |
|
BLAKE2b-256 | e7eaae1ad028835152afb3e16f2fc128ef2d7dc6fa388aff6876363740cde2a2 |
File details
Details for the file tex2img-0.9.1-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8261333e59d50a1dd372756530bbce841b1521870b1c4933c75cf89bd3340137 |
|
MD5 | 056a826f20afaa68a0ba703d622653c1 |
|
BLAKE2b-256 | 5d0c0b25c7c1119c3bd9567cf2402995ee6bef08f60838ae24976f5767a5f421 |
File details
Details for the file tex2img-0.9.1-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 430.6 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2bd472a1d1653732eba7cced3d115fab4faca885e394f3879a55f26b0badc5a |
|
MD5 | a36f991f8fb5979c73d5ef1c6a067256 |
|
BLAKE2b-256 | 2f3ca4c2f05560ddc4d7725d764407027b9b3ab2d644e7a9ee52340c29e33e92 |
File details
Details for the file tex2img-0.9.1-cp36-cp36m-win32.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp36-cp36m-win32.whl
- Upload date:
- Size: 406.1 kB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4c0af63607def01d90cb1f1470e99f80e058fddc5232cb1146a9afafcd92ce8 |
|
MD5 | 7247a6cd0a06e2c51d0acf4ae11eb62b |
|
BLAKE2b-256 | 2f15e3c0a737d9cad72c8531dd478f77e0991e1d0e5e9d6969521a45c7e3b2f5 |
File details
Details for the file tex2img-0.9.1-cp36-cp36m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: tex2img-0.9.1-cp36-cp36m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.6m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59ffe4dbd2af98d10d8570437c4e887d9b0146c4c6d7019288558a51715b169d |
|
MD5 | 4f211533cbfe874f5943048a56c4aec2 |
|
BLAKE2b-256 | 8ca919751c5a341af87d4a8c2c5fafba0ac60f34ba56426406fc931237dd3841 |