Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

basis_universal

> 编程语言
Open source

Basis Universal GPU Texture Codec

3.1K stars0 likes0 views
WebsiteGitHub

About

Basis Universal GPU Texture Codec

basis_universal v2.5

An LDR/HDR portable GPU supercompressed texture transcoding system.

Intro

Basis Universal™ v2.5 is an open source supercompressed LDR/HDR GPU compressed texture interchange system from Binomial LLC that supports two intermediate file formats: the .KTX2 open standard from the Khronos Group, our own ".basis" file format, and Microsoft's .DDS file format. These file formats support rapid transcoding to virtually any compressed GPU texture format released over the past quarter century.

GPU Textures as Infrastructure

Our overall goal is to simplify the encoding and efficient distribution of portable LDR and HDR GPU texture, image, and short animated texture content in a way that is compatible with any GPU, rendering/graphics API, or platform including plain WASM.

The system supports eight modes/codecs. In the order they were implemented:

  1. ETC1S: A supercompressed subset of ETC1 designed for very fast transcoding to other LDR texture formats, low/medium quality but high compression, slightly faster transcoding to other LDR texture formats vs. libjpeg.
  2. UASTC LDR 4x4 (with or without RDO): Custom ASTC 4x4-like format designed for very fast transcoding to other LDR texture formats, high quality
  3. UASTC HDR 4x4: Standard ASTC HDR 4x4 texture data, but constrained for very fast transcoding to BC6H
  4. ASTC HDR 6x6 (with or without RDO): Standard ASTC HDR 6x6
  5. UASTC HDR 6x6 Intermediate ("GPU Photo HDR"): Supercompressed ASTC HDR 6x6
  6. ASTC LDR 4x4-12x12 (all 14 standard ASTC block sizes, with or without basic windowed RDO): Standard ASTC LDR 4x4-12x12
  7. XUASTC LDR 4x4-12x12 (all 14 standard ASTC block sizes, "GPU Photo LDR/SDR"): A latent-space GPU texture codec supporting ASTC LDR supercompression with Weight Grid DCT (Discrete Cosine Transform) for very high quality, extreme bitrate scalability, optional adaptive deblocking (CPU or using a simple GPU pixel shader compatible with mipmapping and filtering), three entropy coding profiles (Zstd, arithmetic or hybrid). See JPEG for ASTC, and the ASTC and XUASTC LDR Usage Guide. As of v2.50 the XUASTC/ASTC encoders now support in-loop deblocking via a global optimization step (using Stochastic Coordinate Descent/SCD). An optional deblocking pixel shader can be used to reduce block artifacts on the largest ASTC/XUASTC block sizes (10x8 or larger by default). The encoder can now optimize the output taking into account the deblocking filter.
  8. XUBC7: A latent-space GPU texture codec supporting lossless or lossy supercompressed standard BC7 (all modes, all mode features, all 2/3 subset partition patterns). Supports near-loss transcoding to ASTC LDR 4x4 and real-time encoding to numerous other LDR texture formats: ETC1/2, PVRTC1, etc. Uses residual weight grid DPCM and (in lossy mode) absolute+residual Weight Grid DCT. Also supports optional RDO (rate-distortion optimization). Lossless bitrate is ~3.5-5.6 bpp, lossy is ~0.8-3.5 bpp, with the lossy sweet spot being around 1.15-2.5 bpp. XUBC7 decompression is fully fixed-point, and the low-level format supports multithreaded transcoding (up to 8 threads). Always uses Zstd.

Each codec supports on the fly transcoding to other GPU texture formats, either by directly converting from one GPU texture latent to another, or by using analytical real-time encoders. For example, XUBC7 can be transcoded to ASTC LDR 4x4, ETC1/2, PVRTC1, etc. XUASTC LDR (any block size) can be transcoded to BC1-7, ETC1/2, etc. Our HDR formats can be transcoded to BC6H (unsigned).

The C/C++ encoder and transcoder libraries can be compiled to native code or WebAssembly (web or WASI), and all encoder/transcoder features can be accessed from JavaScript via a C++ wrapper library which optionally supports WASM multithreading for fast encoding in the browser. WASM WASI builds, for the command line tool and the encoder/transcoder as a WASI module using a pure C API, are also supported.

Full Python support for encoding/transcoding is now available, supporting native or WASM modules, but is still in the early stages of development.

License/Legal

The reference encoder library, transcoder, and most specification documents in this repo (unless otherwise explictly indicated) are Copyright © 2016–2026 Binomial LLC. All rights reserved except as granted under the Apache 2.0 LICENSE. Basis Universal™ is a trademark of Binomial LLC. KTX™ is a trademark of The Khronos Group Inc. See our Apache 2.0 NOTICE file. If you modify the Basis Universal reference source code, specifications, or wiki documents and redistribute the files, you must cause any modified files to carry prominent notices stating that you changed the files (see Apache 2.0 §4(b)).

See our DEP5 file for the complete list of software and their licenses in this repo. The encoder library is Apache 2.0, but it utilizes some open source 3rd party modules (in 'encoder/3rdparty' and in the 'Zstd' directory) to load .QOI, .DDS, .EXR images, to handle Zstd compression, and to unpack ASTC texture blocks. See the LICENSES folder. The transcoder utilizes no 3rd party libraries or dependencies, other than Zstd (which is optional but limits the transcoder to non-Zstd utilizing codecs).

Links

  • Wiki/Specifications
  • Release Notes
  • Live Compression/Transcoding Tool: .KTX2/.DDS Studio v2.50 - A WASM64 compatible browser is recommended (such as Chrome/Edge/Firefox), especially for XUASTC LDR compression, but it works under plain WASM too (with resolution limits due to less available memory).
  • Live WebGL Examples. Note the previous v2.1 examples are here.
  • JavaScript API/WASM/WebGL info

Codec Specific Links

  • UASTC HDR 4x4 Example Images
  • UASTC HDR 6x6 Example Images
  • UASTC HDR 6x6 Support Notes
  • Quick comparison of ARM's astcenc HDR 6x6 encoder vs. ours

Supported LDR GPU Texture Formats

ETC1S, UASTC LDR 4x4, XUASTC LDR 4x4-12x12 and ASTC LDR 4x4-12x12 files can be transcoded to:

  • ASTC LDR 4x4 L/LA/RGB/RGBA 8bpp
  • ASTC LDR 4x4-12x12 (XUASTC/ASTC), 0.89-8bpp
  • BC1-5 RGB/RGBA/X/XY
  • BC7 RGB/RGBA
  • ETC1 RGB, ETC2 RGBA, and ETC2 EAC R11/RG11
  • PVRTC1 4bpp RGB/RGBA and PVRTC2 RGB/RGBA
  • ATC RGB/RGBA and FXT1 RGB
  • Uncompressed LDR raster image formats: 8888/565/4444

Supported HDR GPU Texture Formats

UASTC HDR 4x4, ASTC HDR 6x6, and UASTC HDR 6x6 files can be transcoded to:

  • ASTC HDR 4x4 (8bpp, UASTC HDR 4x4 only)
  • ASTC HDR 6x6 RGB (3.56bpp, ASTC HDR 6x6 or UASTC HDR 6x6 intermediate only)
  • BC6H RGB (8bpp, unsigned, either UASTC HDR 4x4 or UASTC HDR 6x6)
  • Uncompressed HDR raster image formats: RGB_16F/RGBA_16F (half float/FP16 RGB, 48 or 64bpp), or 32-bit/pixel shared exponent RGB_9E5

DDS File Format Transcoding Support

The transcoder module (in v2.5) now fully supports reading and transcoding LDR .DDS files in a variety of formats (BC1-7 and numerous 1/2/3/4 channel uncompressed formats). It supports DX9 and DX10 format files, cubemaps, texture arrays, mipmaps, etc. The .DDS transcoder supports near-lossless transcoding to ASTC LDR 4x4, and real-time encoding to ETC1/2, PVRTC1, etc. This new feature for v2.5 permits standard .DDS files to be easily deployed to any GPU device/API/etc. The encoder library, command line tool, and UI tool can also create .DDS files in a variety of formats, and for development/testing .KTX2 files can be exported to .DDS files.

Supported Texture Compression/Supercompression Modes

  1. ETC1S: A roughly .3-3bpp low to medium quality supercompressed mode based on a subset of ETC1 called "ETC1S". This mode supports variable quality vs. file size levels (like JPEG), alpha channels, built-in compression, and texture arrays optionally compressed as a video sequence using skip blocks (Conditional Replenishment). This mode can be rapidly transcoded to all of the supported LDR texture formats.

  2. UASTC LDR 4x4: An 8 bits/pixel LDR high quality mode. UASTC LDR is a 19 mode subset of the standard ASTC LDR 4x4 (8bpp) texture format, but with a custom block format containing transcoding hints. Transcoding UASTC LDR to ASTC LDR and BC7 is particularly fast and simple, because UASTC LDR is a common subset of both BC7 and ASTC. The transcoders for the other texture formats are accelerated by several format-specific hint bits present in each UASTC LDR block.

This mode supports an optional Rate-Distortion Optimized (RDO) post-process stage that conditions the encoded UASTC LDR texture data in the .KTX2/.basis file so it can be more effectively LZ compressed. More details here.

Here is the UASTC LDR 4x4 specification document.

  1. UASTC HDR 4x4: An 8 bits/pixel HDR high quality mode. This is a 24 mode subset of the standard [ASTC HDR](https://en.wikipedia.org/wiki

Issues· 127 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++compressionddsgpu-texture-compressionimage-processing

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言