Major changes coming to incoming branch of KhronosGroup/KTX-Software

I have recently completed major work in the KTX software (libktx and toktx):

[li]Added a new “ktxTexture” object based API that makes it easy to read, write and modify KTX files when not using OpenGL or Vulkan.
[/li][li]This replaces the interim “ktxReader” API currently found in the incoming branch of KhronosGroup/KTX-Software which was too hard to use, except for its OpenGL loader.
[/li][li]Added a Vulkan image loader, ktxTexture_VkUpload. The caller specifies the type of tiling, the desired usage and optionally the allocator as well as the Vulkan device information. The method automatically maps the KTX format to the equivalent Vulkan image format and checks the physical device properties only proceeding if the device supports the requested tiling and usage for the format.
[/li][li]Added an extensive suite of tests of ktxTexture.
[/li][li]Added Vulkan loader tests including various formats of 2D, 2D array and cubemap textures.
[/li][li]Added an OpenGL loader test using a 2D array texture.
[/li][li]Changed to Apache 2.0 license.

Backward compatibility with the v1 & v2 API is retained. The texture loading parts have been reimplemented using the ktxTexture API. Loader tests and library run on iOS, Linux, macOS and Windows.

ktxTexture replaces and is not compatible with ktxReader. I am sorry for this but the latter turned out to be too difficult to use when not loading into OpenGL or Vulkan. Since the APIs are fairly high level, only a few lines of code need to be changed when moving from old to new.

[li]Reimplemented toktx using the new API.
[/li][li]Removed the ability to create KTX files with unsized formats. It should never have been included.
[/li][li]Added an option to specify whether to create a 1D or 2D texture when the input image height is 1.
[/li][li]Added an option to create a KTX file with a less than full mipmap pyramid, as allowed in the spec.

toktx runs on Linux, macOS & Windows.

This is a huge change. The code can currently be found in the incoming branch of my clone of KhronosGroup/KTX-Software at I would like to get eyeballs on this new API, particularly the Vulkan loader, to make sure it is fit for purpose before I pull it into KhronosGroup/KTX-Software. Please take a look. I value any and all feedback. It will be much easier to get a feel for the API by looking at the Doxygen-generated documentation, which can be viewed at, rather than the code.

Issues can be filed at

Absent major issues emerging, I plan to pull these changes into in about a week.