{"id":15039383,"url":"https://github.com/arm-software/astc-encoder","last_synced_at":"2025-05-14T15:02:38.040Z","repository":{"id":31238471,"uuid":"34799882","full_name":"ARM-software/astc-encoder","owner":"ARM-software","description":"The Arm ASTC Encoder, a compressor for the Adaptive Scalable Texture Compression data format.","archived":false,"fork":false,"pushed_at":"2025-03-21T23:01:58.000Z","size":50544,"stargazers_count":1125,"open_issues_count":13,"forks_count":253,"subscribers_count":54,"default_branch":"main","last_synced_at":"2025-04-05T15:01:43.891Z","etag":null,"topics":["astc","astcenc","compression","image-compression"],"latest_commit_sha":null,"homepage":"https://developer.arm.com/graphics","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ARM-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-29T14:51:23.000Z","updated_at":"2025-04-05T05:19:42.000Z","dependencies_parsed_at":"2024-04-11T16:42:16.682Z","dependency_job_id":"d657f35d-77ed-4b8e-8ab6-dd49e6c35a38","html_url":"https://github.com/ARM-software/astc-encoder","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Fastc-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Fastc-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Fastc-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Fastc-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ARM-software","download_url":"https://codeload.github.com/ARM-software/astc-encoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248596779,"owners_count":21130763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astc","astcenc","compression","image-compression"],"created_at":"2024-09-24T20:42:37.416Z","updated_at":"2025-04-12T16:33:56.458Z","avatar_url":"https://github.com/ARM-software.png","language":"C","readme":"# About\n\nThe Arm® Adaptive Scalable Texture Compression (ASTC) Encoder, `astcenc`, is\na command-line tool for compressing and decompressing images using the ASTC\ntexture compression standard.\n\n## The ASTC format\n\nThe ASTC compressed data format, developed by Arm® and AMD, has been adopted as\nan official extension to the OpenGL®, OpenGL ES, and Vulkan® graphics APIs. It\nprovides a major step forward in terms of both the image quality at a given\nbitrate, and the format and bitrate flexibility available to content creators.\nThis allows more assets to use compression, often at a reduced bitrate compared\nto other formats, reducing memory storage and bandwidth requirements.\n\nRead the [ASTC Format Overview][1] for a quick introduction to the format, or\nread the full [Khronos Data Format Specification][2] for all the details.\n\n## License\n\nThis project is licensed under the Apache 2.0 license. By downloading any\ncomponent from this repository you acknowledge that you accept terms specified\nin the [LICENSE.txt](LICENSE.txt) file.\n\n# Encoder feature support\n\nThe encoder supports compression of low dynamic range (BMP, JPEG, PNG, TGA) and\nhigh dynamic range (EXR, HDR) images, as well as a subset of image data wrapped\nin the DDS and KTX container formats, into ASTC or KTX format output images.\n\nThe decoder supports decompression of ASTC or KTX format input images into low\ndynamic range (BMP, PNG, TGA), high dynamic range (EXR, HDR), or DDS and KTX\nwrapped output images.\n\nThe encoder allows control over the compression time/quality tradeoff with\n`exhaustive`, `verythorough`, `thorough`, `medium`, `fast`, and `fastest`\nencoding quality presets.\n\nThe encoder allows compression time and quality analysis by reporting the\ncompression time, and the Peak Signal-to-Noise Ratio (PSNR) between the input\nimage and the compressed output.\n\n## ASTC format support\n\nThe `astcenc` compressor supports generation of images for all three profiles\nallowed by the ASTC specification:\n\n* 2D Low Dynamic Range (LDR profile)\n* 2D LDR and High Dynamic Range (HDR profile)\n* 2D and 3D, LDR and HDR (Full profile)\n\nIt also supports all of the ASTC block sizes and compression modes, allowing\ncontent creators to use the full spectrum of quality-to-bitrate options ranging\nfrom 0.89 bits/pixel up to 8 bits/pixel.\n\n# Prebuilt binaries\n\nRelease build binaries for the `astcenc` stable releases are provided in the\n[GitHub Releases page][3].\n\n* Change log: [5.x series](./Docs/ChangeLog-5x.md)\n\nBinaries are provided for 64-bit builds on Windows, macOS, and Linux.\n\n## Windows and Linux\n\nFor Windows and Linux the builds of the astcenc are provided as multiple\nbinaries, each tuned for a specific SIMD instruction set.\n\nFor x86-64 we provide, in order of increasing performance:\n\n* `astcenc-sse2` - uses SSE2\n* `astcenc-sse4.1` - uses SSE4.1 and POPCNT\n* `astcenc-avx2` - uses AVX2, SSE4.2, POPCNT, and F16C\n\nThe x86-64 SSE2 builds will work on all x86-64 machines, but it is the slowest\nof the three. The other two require extended CPU instruction set support which\nis not universally available, but each step gains ~15% more performance.\n\nFor Arm we provide, in order of increasing performance:\n\n* `astcenc-sve_256` - uses 256-bit SVE\n* `astcenc-sve_128` - uses 128-bit SVE\n* `astcenc-neon` - uses NEON\n\nNote: The Arm Scalable Vector Extensions (SVE) allow CPUs to have a variable\nvector length. The astcenc implementation is not written in a length-agnostic\nstyle and requires the binary to match the vector length on the host CPU.\n\n## macOS\n\nFor macOS devices we provide a single universal binary `astcenc`, which allows\nthe OS to automatically use the correct binary variant for the current host\nmachine. Support is provided for three architecture slices:\n\n* `x86_64` - uses the `astcenc-sse4.1` build defined above.\n* `x86_64h` - uses the `astcenc-avx2` build defined above.\n* `arm64` - uses the `astcenc-neon` build defined above.\n\n## Repository branches\n\nThe `main` branch is an active development branch for the compressor. It aims\nto be a stable branch for the latest major release series, but as it is used\nfor ongoing development expect it to have some volatility. We recommend using\nthe latest stable release tag for production development.\n\nThe `4.x` branch is a stable branch for the older 4.x release series. It is no\nlonger under active development, but is a supported branch that continues to\nget back-ported bug fixes.\n\nThe `1.x`, `2.x`, and `3.x` branches are stable branches for older releases.\nThey are no longer under active development or getting bug fixes.\n\nAny other branches you might find are development branches for new features or\noptimizations, so might be interesting to play with but should be considered\ntransient and unstable.\n\n\n# Getting started\n\nOpen a terminal, change to the appropriate directory for your system, and run\nthe astcenc encoder program, like this on Linux or macOS:\n\n    ./astcenc\n\n... or like this on Windows:\n\n    astcenc\n\nInvoking `astcenc -help` gives an extensive help message, including usage\ninstructions and details of all available command line options. A summary of\nthe main encoder options are shown below.\n\n## Compressing an image\n\nCompress an image using the `-cl` \\ `-cs` \\ `-ch` \\ `-cH` modes. For example:\n\n    astcenc -cl example.png example.astc 6x6 -medium\n\nThis compresses `example.png` using the LDR color profile and a 6x6 block\nfootprint (3.56 bits/pixel). The `-medium` quality preset gives a reasonable\nimage quality for a relatively fast compression speed, so is a good starting\npoint for compression. The output is stored to a linear color space compressed\nimage, `example.astc`.\n\nThe modes available are:\n\n* `-cl` : use the linear LDR color profile.\n* `-cs` : use the sRGB LDR color profile.\n* `-ch` : use the HDR color profile, tuned for HDR RGB and LDR A.\n* `-cH` : use the HDR color profile, tuned for HDR RGBA.\n\nIf you intend to use the resulting image with the decode mode extensions to\nlimit the decompressed precision to UNORM8, it is recommended that you also\nspecify the `-decode_unorm8` flag. This will ensure that the compressor uses\nthe correct rounding rules when choosing encodings.\n\n## Decompressing an image\n\nDecompress an image using the `-dl` \\ `-ds` \\ `-dh` \\ `-dH` modes. For example:\n\n    astcenc -dh example.astc example.tga\n\nThis decompresses `example.astc` using the full HDR feature profile, storing\nthe decompressed output to `example.tga`.\n\nThe modes available mirror the options used for compression, but use a `d`\nprefix. Note that for decompression there is no difference between the two HDR\nmodes, they are both provided simply to maintain symmetry across operations.\n\n## Measuring image quality\n\nReview the compression quality using the `-tl` \\ `-ts` \\ `-th` \\ `-tH` modes.\nFor example:\n\n    astcenc -tl example.png example.tga 5x5 -thorough\n\nThis is equivalent to using using the LDR color profile and a 5x5 block size\nto compress the image, using the `-thorough` quality preset, and then\nimmediately decompressing the image and saving the result. This can be used\nto enable a visual inspection of the compressed image quality. In addition\nthis mode also prints out some image quality metrics to the console.\n\nThe modes available mirror the options used for compression, but use a `t`\nprefix.\n\n## Experimenting\n\nEfficient real-time graphics benefits from minimizing compressed texture size,\nas it reduces memory footprint, reduces memory bandwidth, saves energy, and can\nimprove texture cache efficiency. However, like any lossy compression format\nthere will come a point where the compressed image quality is unacceptable\nbecause there are simply not enough bits to represent the output with the\nprecision needed. We recommend experimenting with the block footprint to find\nthe optimum balance between size and quality, as the finely adjustable\ncompression ratio is one of major strengths of the ASTC format.\n\nThe compression speed can be controlled from `-fastest`, through `-fast`,\n`-medium` and `-thorough`, up to `-exhaustive`. In general, the more time the\nencoder has to spend looking for good encodings the better the results, but it\ndoes result in increasingly small improvements for the amount of time required.\n\nThere are many other command line options for tuning the encoder parameters\nwhich can be used to fine tune the compression algorithm. See the command line\nhelp message for more details.\n\n# Documentation\n\nThe [ASTC Format Overview](./Docs/FormatOverview.md) page provides a high level\nintroduction to the ASTC texture format, how it encodes data, and why it is\nboth flexible and efficient.\n\nThe [Effective ASTC Encoding](./Docs/Encoding.md) page looks at some of the\nguidelines that should be followed when compressing data using `astcenc`.\nIt covers:\n\n* How to efficiently encode data with fewer than 4 channels.\n* How to efficiently encode normal maps, sRGB data, and HDR data.\n* Coding equivalents to other compression formats.\n\nThe [ASTC Developer Guide][5] document (external link) provides a more detailed\nguide for developers using the `astcenc` compressor.\n\nThe [.astc File Format](./Docs/FileFormat.md) page provides a light-weight\nspecification for the `.astc` file format and how to read or write it.\n\nThe [Building ASTC Encoder](./Docs/Building.md) page provides instructions on\nhow to build `astcenc` from the sources in this repository.\n\nThe [Testing ASTC Encoder](./Docs/Testing.md) page provides instructions on\nhow to test any modifications to the source code in this repository.\n\n# Support\n\nIf you have issues with the `astcenc` encoder, or questions about the ASTC\ntexture format itself, please raise them in the GitHub issue tracker.\n\nIf you have any questions about Arm GPUs, application development for Arm GPUs,\nor general mobile graphics development or technology please submit them on the\n[Arm Community graphics forums][4].\n\n- - -\n\n_Copyright © 2013-2025, Arm Limited and contributors. All rights reserved._\n\n[1]: ./Docs/FormatOverview.md\n[2]: https://www.khronos.org/registry/DataFormat/specs/1.4/dataformat.1.4.html#ASTC\n[3]: https://github.com/ARM-software/astc-encoder/releases\n[4]: https://community.arm.com/support-forums/f/graphics-gaming-and-vr-forum/\n[5]: https://developer.arm.com/documentation/102162/latest/?lang=en\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farm-software%2Fastc-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farm-software%2Fastc-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farm-software%2Fastc-encoder/lists"}