EvonX

Guide + calculator

KTX2 texture compression, explained with numbers.

A JPEG downloads small but unpacks to a full-size image on the graphics card. A KTX2 texture stays compressed in GPU memory. Use the calculator to see the difference for your game, then learn when to use ETC1S, when UASTC and how to make the files.

  • Interactive calculator
  • ETC1S vs UASTC
  • Engine support

By the EvonX team · Updated · 3 min read

What is a KTX2 file?

KTX2 is a container format for GPU textures from the Khronos Group, the body behind OpenGL, Vulkan and glTF. With Basis Universal compression inside, one KTX2 file is transcoded at load time into whatever compressed format the device's GPU supports (BC, ETC or ASTC), so textures use 4–8 times less graphics memory than PNG or JPEG.

GPU memory calculator

Pick a texture size and how many textures your scene uses. The bars show GPU memory, not download size.

Loading the tool…

Why PNG and JPEG waste GPU memory

Graphics cards cannot sample a PNG or a JPEG directly. The browser decodes the file into raw pixels, four bytes each (red, green, blue, alpha), and uploads those. A 2048×2048 texture is about 16 MB on the GPU, about 21 MB with mipmaps, whether the file you downloaded was 4 MB or 400 KB.

GPUs do understand their own block-compressed formats: BC1–BC7 on desktops, ETC2 and ASTC on phones. These keep textures compressed in memory and decompress tiny blocks on the fly while drawing. The catch is that no single format works everywhere. That is the problem KTX2 with Basis Universal solves: you ship one file, and the loader transcodes it to the right GPU format on each device in milliseconds.

ETC1S vs UASTC: which to choose

Comparison of the two Basis Universal modes
ETC1SUASTC
GPU memoryLowest (about 0.5 byte/pixel)Higher (about 1 byte/pixel)
Download sizeVery smallLarger; usually zstd-compressed inside KTX2
QualityGood; some blockiness and colour bandingNear-lossless
Best forColour/albedo textures, terrain, propsNormal maps, UI, text, hero characters
Transcodes toBC1/BC3, ETC1/ETC2, ASTC and moreBC7, ASTC 4×4, ETC2 and more

How to make KTX2 textures

  1. Install the Khronos tools

    The free KTX-Software package includes the toktx and ktx command-line tools for Windows, macOS and Linux.

  2. Convert colour textures with ETC1S

    For example: toktx --t2 --encode etc1s --genmipmap albedo.ktx2 albedo.png. Lower quality settings make smaller files.

  3. Convert normal maps with UASTC

    For example: toktx --t2 --encode uastc --uastc_quality 2 --zcmp 18 --assign_oetf linear normal.ktx2 normal.png. Normal maps are data, so they use a linear transfer function.

  4. Load them in your engine

    three.js: KTX2Loader with the Basis transcoder files. Babylon.js and PlayCanvas load KTX2 natively. In glTF, textures use the KHR_texture_basisu extension; glTF-Transform can convert a whole GLB in one command.

Frequently asked questions

Is KTX2 smaller than JPEG to download?

ETC1S files are often similar to or smaller than JPEG. UASTC files are larger, but compress well with zstd inside the container. The big win is GPU memory, not download size.

Do all browsers support KTX2?

KTX2 is not a browser image format; your engine loads it with a WebAssembly transcoder, so it works in every browser that runs WebGL. The transcoder picks the best GPU format each device supports.

Does glTF support KTX2?

Yes, through the KHR_texture_basisu extension. GLB files with KTX2 textures load in three.js, Babylon.js and other engines that ship the transcoder.

What does the calculator assume?

Standard bits per pixel for each GPU format (32 for RGBA8, 4 for BC1/ETC1, 8 for BC7/ASTC 4×4) and a one-third increase for a full mipmap chain. Real drivers can add small amounts of padding.

EvonX AI game maker

Got the asset? Now make the game.

Describe your game in one sentence and EvonX builds it: code, art, sound and a link you can share. Free to start, no download, plays on any phone.

Free to start · Earn money from your games
Try one