Professional Adaptive Scalable Texture Compression Decoder
Adaptive Scalable Texture Compression (ASTC) is an advanced lossy texture compression technology developed by ARM. It provides excellent compression ratios and image quality across various block sizes.
// ASTC Header Structure (16 bytes) // Bytes 0-3: Magic Number (0x13, 0xAB, 0xA1, 0x5C) // Byte 4: Block Width // Byte 5: Block Height // Byte 6: Block Depth // Bytes 7-9: Image Width (24-bit LE) // Bytes 10-12: Image Height (24-bit LE) // Bytes 13-15: Image Depth (24-bit LE)
The decoder provides several ways to decode ASTC textures:
// Basic decoding const decodedData = decodeASTCTexture(astcData); // Class-based approach const decoder = new ASTCDecoder(); await decoder.init(); const decodedData = decoder.decode(astcData); // Parse header only const header = parseASTCHeader(astcData);
ASTC supports various block sizes for different compression ratios: