Python wrapper for the ASTC texture compression encoder. Current version 0.1.12, released as a PyPI package. Wraps the official astc-encoder library (C++) via ctypes. Used for compressing images to ASTC format, common in GPU texture workflows. Maintained on GitHub.
pip install astc-encoder-pyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compress an RGBA image to ASTC format using Pillow for image loading and numpy for pixel data.
Ensure pixels = np.asarray(image, dtype=np.uint8).flatten() before passing to encode().
Change 'import astc_encoder; encoder = astc_encoder.Encoder()' to 'from astc_encoder import ASTCEncoder; encoder = ASTCEncoder()'.
Use compression_mode=CompressionMode.MEDIUM instead of quality=50.