Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.

Home of the KTX File Format Specification

Build Status

KTX is a file format that can be used for storing GPU-ready texture data (with cubemaps, mip levels, etc). Like DDS but with more features and more formal specification. It supports Basis Universal transcodable formats and supercompression which can yield JPEG-sized universal textures. glTF will use Basis Universal textures in KTX v2 containers.

Click to see the latest published version of the KTX File Format Specification or latest published version of the KTX Fragment URI (they look much better than the ersatz views provided by GitHub) or run


in a Unix-like environment with AsciiDoctor installed to generate the publishable specs. They are the files out/ktxspec_v2.html and out/ktx_frag.html. Everything needed is inlined.

The canonical spec. text is in the file ktxspec.adoc.

If you have questions or comments that don't merit creating an issue such as "why did you do so-and-so?" use GitHub Discussions.

GPU texture format mappings

To ensure correct mappings from Vulkan's VkFormat to other GPU APIs, this repo additionally contains:

  • JSON database (schema) with mappings to OpenGL, Direct3D, and Metal enums.
  • Switch-case generator that produces 5 files with simple C-like case-return statements.

    Usage: ./generate_format_switches.rb [<out_dir>]

$Date$ keyword expansion

A few auxiliary files have $Date$ keywords. If you care about having the proper dates shown on files in your workspace, you must follow the instructions below.

$Date$ keywords are expanded via a smudge & clean filter. To install the filter, issue the following commands in the root of your clone.

On Unix (Linux, Mac OS X, etc.) platforms and Windows using Git for Windows' Git Bash or Cygwin's bash terminal:

git checkout

On Windows with the Command Prompt (requires git.exe in a directory on your %PATH%):

git checkout

The first command adds an [include] of the repo's .gitconfig to the local git config file .git/config, i.e. the one in your clone of the repo. .gitconfig contains the config of the "dater" filter. The remaining commands force a new checkout of the affected files to smudge them with the date. These two are unnecessary if you plan to edit these files.