Converts common image formats (PNG, JPG, etc.) to GPU-native compressed (BCn, ETC, ASTC) in KTX containers.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
CMakeLists.txt
README.md
img2ktx.cpp
img2ktx.sln
ispc_texcomp.dll
ispc_texcomp.exp
ispc_texcomp.h
ispc_texcomp.lib
license.txt
stb_image.h
stb_image_resize.h

README.md

img2ktx

img2ktx is a simple command-line utility.

It currently runs on Windows, Linux and MacOS. Use CMake to generate a project file for your platform.

It loads images with stb_image. Supported formats include JPEG, PNG, BMP, TGA, GIF, etc.

It optionally generates mipmap chains with stb_image_resize.

It compresses the mipmaps to BC1, BC3, BC7, ETC1, or ASTC with Intel's ISPC Texture Compressor. It can also output uncompressed 32-bit RGBA images. Only the Windows ispc_texcomp library is included in the repo; users on other platforms must provide their own.

It writes the compressed images to a KTX file. If more than one image is provided with identical dimensions, the output KTX file can be either a 2D texture array or a cubemap.

Download pre-built binaries from the Releases page.

That's it!

It may eventually do the following things as well:

  • Output DDS files, because inevitably somebody is going to ask for it.
  • Convert animated GIFs directly into array textures, because what 3D graphics application isn't improved by animated GIFs?
  • Run as a web server, with CGI and XMLRPC interfaces.