astc-encoder

ARM-softwareApache-2.0活跃维护

Arm 官方的 ASTC 纹理压缩命令行工具与编解码库,用来把图像压成 Adaptive Scalable Texture Compression 格式,适合游戏和移动端图形资源。

The Arm ASTC Encoder, a compressor command line tool and codec library for the Adaptive Scalable Texture Compression image format.

5.7.1发布于 2026-11-03 21:40 UTC1,317star +1 / 7 天293fork同步于 2026-11-10 05:54 UTC

怎么上手

README 里没有找到可直接复制的安装命令

README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。

硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本5.7.1
  1. 5.7.1最新正式版2026-11-03 · 2026-11-03 21:40 UTC

    Status: Released November 2026.

    The 5.7.1 release is a minor maintenance release that addresses a small number of bugs. These issues are unlikely to affect normal usage, but the fixes improve robustness and reliability.

    • General:
      • Bug fix: Improved command line option parameter validation to more reliably detect malformed or out-of-range values and emit an error.
      • Bug fix: Capped alpha-scale (-a) option radius to 64 texels to avoid very large intermediate buffer memory allocation.
      • Bug fix: Avoid UB caused by SIMD code accessing uninitialized entries in the image_block input data arrays, even if those lanes are benign and effectively ignored.
      • Bug fix: Avoid float16_to_float() decoding negative values as NaN in builds using x86-64 F16C instructions.
      • Bug fix: Avoid div-by-zero error by normalizing block_z inside astcenc_context_alloc() in cases where user manually zeroed the dimension after calling astcenc_config_init().

    Binary release sha256 checksums

    d87287e02e3fd335334dace5a6a1ffcb705ed5aa9d5a5c5624fa50860f665fde  astcenc-5.7.1-linux-arm64.zip
    f1d576f0801e7701548da78d782f4bf70dfde3673a238d1a2ac0ebd3511b2f37  astcenc-5.7.1-linux-x64.zip
    cb2dd75e33fcc12ebaae9e2230649e30da10c152b029a6d2f3440f6d45ed5c45  astcenc-5.7.1-macos-universal.zip
    2d8f4084fd2d5d88e5caca1c6c1fe6916f053510b26ec0be0bf12bef9ffe99dd  astcenc-5.7.1-windows-arm64.zip
    117ed7cc2b0cc4f3d5774eaa1bde3a2ba75695c2f490e84e4a08d1726c963db8  astcenc-5.7.1-windows-x64.zip
    
  2. 5.7.02026-07-31 · 2026-07-31 11:23 UTC
    查看更新说明

    Status: Released August 2026.

    The 5.7.0 release is a minor maintenance release.

    • Command line tool updates:
      • Bug fix: Avoid pixel count overflow when loading input PNG file.
      • Bug fix: Error if payload is undersized for stated image dimensions when loading compressed input KTX file.
      • Improvement: Top-level -help text has been rewritten to improve clarity and consistency.
      • Change: Removed -repeats benchmarking option, because we prefer to repeat by invoking the command line multiple times. This gives performance results closer to what a real user sees.
      • Change: Removed -dimage diagnostic images generation option from normal builds. Now only available for builds configured with ASTCENC_DIAGNOSTICS=ON.

    Binary release sha256 checksums

    43f2544127f40340768e7cac317df74101a0b0e30619fe68c6e2628ceaa91692  astcenc-5.7.0-linux-arm64.zip
    6c6b299b17608e1ee74db9c491cdc793b12b2b104a4b52222e358d78ae0662a9  astcenc-5.7.0-linux-x64.zip
    374b2f0aea1d3ab5f849784666d6ece6e27b4bc1f945e5c90d6eeabf00e955f8  astcenc-5.7.0-macos-universal.zip
    5b18285fda1eeb884fff5d1846c5669bafd38552c55c6a08d5bd8f6b8589c081  astcenc-5.7.0-windows-arm64.zip
    cbde7c78adcc90d0d90ecf10f32d03f3340fbe1720cb6d6c892147d625e74d2d  astcenc-5.7.0-windows-x64.zip
    
  3. 5.6.02026-07-01 · 2026-07-01 21:21 UTC
    查看更新说明

    Status: Released July 2026

    The 5.6.0 release is a minor maintenance release.

    • Codec library updates:
      • Bug fix: Avoid undefined behavior caused by passing floating point values outside of the [0.0, 1.0] range as input data for a UNORM color channel.
      • Bug fix: Avoid undefined behavior caused by unaligned access in SSE, AVX2, and NEON SIMD library implementations.
    • Command line tool updates:
      • Bug fix: Fixed incorrect plane stride when writing an uncompressed 3D LDR image to a DDS container.
      • Bug fix: Fixed potential integer overflow when storing very large uncompressed images to a .dds or .ktx output image format.
      • Bug fix: Fixed missing initialization of the reserved2 field in the DDS file header when writing uncompressed .dds output images.
      • Bug fix: Fixed typos and grammar issues in the command line -help text.
    073ef4ec962e89fa837d7c2157bf1a373c4e809e2dc26726fec7b408f69fa373  astcenc-5.6.0-linux-arm64.zip
    4fa262fb4883997b2b38a95c0de3b7ee26d22ac7ab1ebd030558089f2e917502  astcenc-5.6.0-linux-x64.zip
    13d5b890777898e11ec025c17343a599b069b057c2bfea4dda7ef6fd8b73bdc4  astcenc-5.6.0-macos-universal.zip
    0aafb075bbf4143b3928139016d7c37b89a68e14742d0fb40cb005d42e2c6f2a  astcenc-5.6.0-windows-arm64.zip
    25871b3f798005b11cfb2b369ee7911043d4d5e7bcde5b10cb8b51f81bf4a95d  astcenc-5.6.0-windows-x64.zip
    
  4. 5.5.02026-06-09 · 2026-06-09 10:34 UTC
    查看更新说明

    Status: June 2026

    The 5.5.0 release is a minor maintenance release, fixing minor functional issues and improving robustness when processing invalid images.

    • Codec library updates:
      • Bug fix: Correct vfloat8 NaN inequality comparisons for AVX2 builds, so that decompressing an invalid encoding returns the correct max magenta error color for UNORM output formats instead of black.
      • Bug fix: Add overflow detection so that the API returns errors for cases when input image size would result in integer overflow in calculations of total texel count, total block count, or compressed image byte size.
      • Bug fix: Fix bad offset calculation in compute_averages() when using 3D block sizes.
      • Bug fix: Add missing low-clamp when storing decompressed HDR data into a UNORM8 image. Prior to this fix, output colors would be incorrect if a HDR void-extent block contained a negative FP16 constant color component.
      • Improvement: Return standard error color when decompression requires an unavailable partitioning when using an ASTCENC_FLG_SELF_DECOMPRESS_ONLY context. Note that this is still not allowed API usage and may trigger asserts in a debug build.
    • Command line tool updates:
      • Update: Update stb_image to v2.30.
      • Update: Update Wuffs to v0.3.4.
      • Update: Update TinyEXR to v1.0.13.
      • Bug fix: Use C++ RAII to manage resource lifetime, removing resource leaks when an error condition is encountered.
      • Bug fix: Report errors for .astc, .dds, and .ktx input image sizes that would result in integer overflow in calculations of total block count or data size.
      • Bug fix: Avoid undefined behavior on NaN to int conversion triggered by atan2() calls when both inputs are zero.
      • Bug fix: Avoid undefined behavior on left shift of negative integer, that is triggered for some HDR encodings in hdr_alpha_unpack().
      • Bug fix: Redirect error logging for failed .dds and .ktx input image loading to stderr, and improve message consistency.

    Binary release sha256 checksums

    aee2efe79fa07ab5b341200f45b2a613b540490e64047107fbbc9bdbb3f4b179  astcenc-5.5.0-linux-arm64.zip
    ecf4c6bc858ce6a3b7ac49af800c5d1268410cebaed35bc998e6eeb8b547ceca  astcenc-5.5.0-linux-x64.zip
    52b7c3380ac1e6afa1565c4fc86f571c510fed67f38d6e80c2f3cc3f23ae3059  astcenc-5.5.0-macos-universal.zip
    e342902eed198011ef88267f081695905ad6586be25fd923a5a9e039f2dab083  astcenc-5.5.0-windows-arm64.zip
    658abc1ca76990bb5a00402a122e3b8b041f0ce416fe966c484466bddf9081e7  astcenc-5.5.0-windows-x64.zip
    
  5. 5.4.02026-05-05 · 2026-05-05 12:11 UTC
    查看更新说明

    Status: May 2026

    The 5.4.0 release is a minor feature release.

    This release includes changes to the public interface in the astcenc.h header. We always recommend rebuilding your client-side code using the header from the same release to avoid compatibility issues.

    Thank you to the community contributors for this release cycle, who contributed the changes for astcenc.h C compliance, RISC-V backend support, and new fuzzers that significantly increase our OSS Fuzz code coverage.

    • General:
      • Improvement: The interface header astcenc.h is now C compliant to make it usable from C programs.
      • Improvement: Contexts using the same configuration can now share read-only data tables. This can significantly reduce the amount of memory needed for applications that parallelize by processing multiple images in parallel instead of slicing a single image in parallel.
      • Improvement: Decompressor (astcdec) builds, which lack compression support, now use a smaller block_size_descriptor by omitting fields that are only needed for compression. This reduces the size of a decompressor context by more than 10MB!
      • Optimization: A SIMD backend for the RISC-V Vector extensions has been added, and is auto-selected when configured with ASTCENC_ISA_NONE and a core with a 256-bit vector width. See Building.md for details.
      • Bug fix: Avoid using an undefined quant_weight value if all one partition trials return an error block.
      • Bug fix: Remove remaining instances of type aliasing through unions.
      • Bug fix: Avoid compiler double definition warning for NOMINMAX when compiling with MinGW.
      • Bug fix: Avoid compiler floating point model override warning when compiling with Clang 20.

    Binary release sha256 checksums

    a892b8630edfb79334fefe2a2312af934fc385f3190ca06ee882a264835ae7b4  astcenc-5.4.0-linux-arm64.zip
    c98cb38b979a0d3464d1d445e7b485f7356457cdbc5d9c4bc9450f9ce45ebf73  astcenc-5.4.0-linux-x64.zip
    4d02d5cad4a026e026b60f0e8dd02064858637f6f96e942d986a9e96003bf6f3  astcenc-5.4.0-macos-universal.zip
    8d0ef8eb9d0b2519776ba5609a0f01249827fe730f8932de11bb6b06d9ac5f17  astcenc-5.4.0-windows-arm64.zip
    1f0cbc67550caf158c3c0ac7689e8defefcd50e63f4b17d9b321c5728142e30d  astcenc-5.4.0-windows-x64.zip
    

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    About

    The Arm® Adaptive Scalable Texture Compression (ASTC) Encoder, astcenc, is a command-line tool for compressing and decompressing images using the ASTC texture compression standard.

    The ASTC format

    The ASTC compressed data format, developed by Arm® and AMD, has been adopted as an official extension to the OpenGL®, OpenGL ES, and Vulkan® graphics APIs. It provides a major step forward in terms of both the image quality at a given bitrate, and the format and bitrate flexibility available to content creators. This allows more assets to use compression, often at a reduced bitrate compared to other formats, reducing memory storage and bandwidth requirements.

    Read the ASTC Format Overview for a quick introduction to the format, or read the full Khronos Data Format Specification for all the details.

    License

    This project is licensed under the Apache 2.0 license. By downloading any component from this repository you acknowledge that you accept terms specified in the LICENSE.txt file.

    Encoder feature support

    The encoder supports compression of low dynamic range (BMP, JPEG, PNG, TGA) and high dynamic range (EXR, HDR) images, as well as a subset of image data wrapped in the DDS and KTX container formats, into ASTC or KTX format output images.

    The decoder supports decompression of ASTC or KTX format input images into low dynamic range (BMP, PNG, TGA), high dynamic range (EXR, HDR), or DDS and KTX wrapped output images.

    The encoder allows control over the compression time/quality tradeoff with exhaustive, verythorough, thorough, medium, fast, and fastest encoding quality presets.

    The encoder allows compression time and quality analysis by reporting the compression time, and the Peak Signal-to-Noise Ratio (PSNR) between the input image and the compressed output.

    ASTC format support

    The astcenc compressor supports generation of images for all three profiles allowed by the ASTC specification:

    • 2D Low Dynamic Range (LDR profile)
    • 2D LDR and High Dynamic Range (HDR profile)
    • 2D and 3D, LDR and HDR (Full profile)

    It also supports all of the ASTC block sizes and compression modes, allowing content creators to use the full spectrum of quality-to-bitrate options ranging from 0.89 bits/pixel up to 8 bits/pixel.

    Prebuilt binaries

    Release build binaries for the astcenc stable releases are provided in the GitHub Releases page.

    Binaries are provided for 64-bit builds on Windows, macOS, and Linux.

    Windows and Linux

    For Windows and Linux, the builds of astcenc are provided as multiple binaries, each tuned for a specific SIMD instruction set.

    For x86-64 we provide multiple SIMD builds. From the baseline ISA to the latest ISA, we ship:

    • astcenc-sse2 - uses SSE2
    • astcenc-sse4.1 - uses SSE4.1 and POPCNT
    • astcenc-avx2 - uses AVX2, SSE4.2, POPCNT, and F16C
    • astcenc-avx512 - uses AVX-512F, AVX-512BW, AVX-512DQ, AVX-512VL, AVX-512VBMI, POPCNT, and F16C

    The x86-64 SSE2 builds will work on all x86-64 machines, but it is the slowest of the four. The other builds require extended CPU instruction set support which is not universally available, but can give better performance. AVX-512 performance varies, and may even be slower than the AVX2 build on some hardware.

    For Arm we provide, in order of increasing performance:

    • astcenc-sve_256 - uses 256-bit SVE
    • astcenc-sve_128 - uses 128-bit SVE
    • astcenc-neon - uses NEON

    Note: The Arm Scalable Vector Extensions (SVE) allow CPUs to have a variable vector length. The astcenc implementation is not written in a length-agnostic style and requires the binary to match the vector length on the host CPU.

    macOS

    For macOS, we provide a single universal binary astcenc, which allows the OS to automatically use the correct binary variant for the current host machine. Support is provided for three architecture slices:

    • x86_64 - uses the astcenc-sse4.1 build defined above.
    • x86_64h - uses the astcenc-avx2 build defined above.
    • arm64 - uses the astcenc-neon build defined above.

    Repository branches

    The main branch is an active development branch for the compressor. It aims to be a stable branch for the latest major release series, but as it is used for ongoing development expect it to have some volatility. We recommend using the latest stable release tag for production development.

    The 4.x branch is a stable branch for the older 4.x release series. It is no longer under active development, but is a supported branch that continues to get back-ported bug fixes.

    Older releases are no longer available as a release branch, but any official releases are still available via their git tag. We recommend that developers using an older version migrate to the latest 5.x series stable release tag.

    Any other branches you might find are development branches for new features or optimizations, so might be interesting to play with but should be considered transient and unstable.

    Getting started

    Open a terminal, change to the appropriate directory for your system, and run the astcenc encoder program, like this on Linux or macOS:

    ./astcenc
    

    ... or like this on Windows:

    astcenc
    

    Invoking astcenc -help gives an extensive help message, including usage instructions and details of all available command line options. A summary of the main encoder options is shown below.

    Compressing an image

    Compress an image using the -cl \ -cs \ -ch \ -cH modes. For example:

    astcenc -cl example.png example.astc 6x6 -medium
    

    This compresses example.png using the LDR color profile and a 6x6 block footprint (3.56 bits/pixel). The -medium quality preset gives a reasonable image quality for a relatively fast compression speed, so is a good starting point for compression. The output is stored to a linear color space compressed image, example.astc.

    The modes available are:

    • -cl : use the linear LDR color profile.
    • -cs : use the sRGB LDR color profile.
    • -ch : use the HDR color profile, tuned for HDR RGB and LDR A.
    • -cH : use the HDR color profile, tuned for HDR RGBA.

    If you intend to use the resulting image with the decode mode extensions to limit the decompressed precision to UNORM8, it is recommended that you also specify the -decode_unorm8 flag. This will ensure that the compressor uses the correct rounding rules when choosing encodings.

    Decompressing an image

    Decompress an image using the -dl \ -ds \ -dh \ -dH modes. For example:

    astcenc -dh example.astc example.exr
    

    This decompresses example.astc using the full HDR feature profile, storing the decompressed output to example.exr.

    The modes available mirror the options used for compression, but use a d prefix. Note that for decompression there is no difference between the two HDR modes, they are both provided simply to maintain symmetry across operations.

    Measuring image quality

    Review the compression quality using the -tl \ -ts \ -th \ -tH modes. For example:

    astcenc -tl example.png example.tga 5x5 -thorough
    

    This is equivalent to using the LDR color profile and a 5x5 block size to compress the image, using the -thorough quality preset, and then immediately decompressing the image and saving the result. This can be used to enable a visual inspection of the compressed image quality. In addition this mode also prints out some image quality metrics to the console.

    The modes available mirror the options used for compression, but use a t prefix.

    Experimenting

    Efficient real-time graphics benefits from minimizing compressed texture size, as it reduces memory footprint, reduces memory bandwidth, saves energy, and can improve texture cache efficiency. However, like any lossy compression format there will come a point where the compressed image quality is unacceptable because there are simply not enough bits to represent the output with the precision needed. We recommend experimenting with the block footprint to find the optimum balance between size and quality, as the finely adjustable compression ratio is one of the major strengths of the ASTC format.

    The compression speed can be controlled from -fastest, through -fast, -medium and -thorough, up to -exhaustive. In general, the more time the encoder has to spend looking for good encodings the better the results, but it does result in increasingly small improvements for the amount of time required.

    There are many other command line options for tuning the encoder parameters which can be used to fine tune the compression algorithm. See the command line help message for more details.

    Documentation

    The ASTC Format Overview page provides a high level introduction to the ASTC texture format, how it encodes data, and why it is both flexible and efficient.

    The Effective ASTC Encoding page looks at some of the guidelines that should be followed when compressing data using astcenc. It covers:

    • How to efficiently encode data with fewer than 4 channels.
    • How to efficiently encode normal maps, sRGB data, and HDR data.
    • Coding equivalents to other compression formats.

    The ASTC Developer Guide document (external link) provides a more detailed guide for developers using the astcenc compressor.

    The .astc File Format page provides a light-weight specification for the .astc file format and how to read or write it.

    The Building ASTC Encoder page provides instructions on how to build astcenc from the sources in this repository.

    The Testing ASTC Encoder page provides instructions on how to test any modifications to the source code in this repository.

    Support

    If you have issues with the astcenc encoder, or questions about the ASTC texture format itself, please raise them in the GitHub issue tracker.

    If you have any questions about Arm GPUs, application development for Arm GPUs, or general mobile graphics development or technology please submit them on the Arm Community graphics forums.


    Copyright © 2013-2026, Arm Limited and contributors.