Registry / devops / texture2ddecoder

texture2ddecoder

JSON →
library1.0.6pypypi✓ verified 80d ago

A Python wrapper for Perfare's Texture2DDecoder library, enabling decoding of Unity Texture2D assets (DXT, ETC, PVRTC, ASTC, etc.) from asset bundles. Current version: 1.0.6. Release cadence is low, primarily maintenance.

pip install texture2ddecoder
INSTALL
IMPORT
SIG · TEXTURE2DDECODER
T
texture2ddecoder
devopspythonv1.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

decode_astc
from texture2ddecoder import decode_astc
from texture2ddecoder import Texture2DDecoder
decode_bc1
from texture2ddecoder import decode_bc1
decode_etc1
from texture2ddecoder import decode_etc1

Initialize the decoder and call format-specific methods (e.g., DXT1, ETC2_RGB, ASTC, etc.) with width, height, and compressed data bytes.

from texture2ddecoder import Texture2DDecoder # Initialize decoder (no arguments needed) decoder = Texture2DDecoder() # Example: decode a DXT1 texture (width=64, height=64, data is raw DXT1 bytes) width, height = 64, 64 # Assume 'encoded_data' contains raw DXT1 compressed bytes # decoded = decoder.DXT1(width, height, encoded_data) # print('Decoded texture shape:', decoded.shape) # For a list of supported formats, see: # https://github.com/K0lb3/texture2ddecoder
Debug
Known issues
gotchaAll format methods require raw compressed data bytes as input, not a file path or image buffer. Common mistake: passing a path to a .dds file instead of reading its bytes.
fix
Open the file in binary mode and read all bytes: with open('texture.dds', 'rb') as f: data = f.read()
affects: >=1.0.0
gotchaThe library does not perform automatic format detection. You must know the compressed texture format (e.g., DXT1, DXT5, ETC2_RGB, ASTC_4x4) and call the corresponding method.
fix
Check the texture metadata (e.g., from Unity assets) to determine the format, then call the appropriate method (e.g., decoder.DXT1(...), decoder.ASTC(...)).
affects: >=1.0.0
breakingVersion 1.0.0 changed method signatures from earlier pre-release versions. Methods now expect (width, height, data) instead of (data, width, height).
fix
Update calls to use (width, height, data) ordering.
affects: >=1.0.0
deprecatedThe method 'decode' (generic) is deprecated in favor of format-specific methods like DXT1, ASTC, etc. It may be removed in a future release.
fix
Use format-specific methods: decoder.DXT1(...), decoder.ETC2_RGB(...), etc.
affects: >=1.0.0
gotchaOn some platforms (especially macOS ARM), the library may fail to load the native binary due to missing dependencies or architecture mismatches. The error often appears as 'OSError: dlopen: image not found'.
fix
Install from source or use a precompiled wheel for your platform. If missing, try building from source with: pip install --no-binary texture2ddecoder texture2ddecoder
affects: >=1.0.0
Upgrade
Version history
1.0.6latest on PyPI · released Jan 16, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
67 hits · last 30 days
node
64
Resources