KTX to PNG Converter

Add an older KTX 1 texture and get its full-size picture as a PNG, clear parts kept wherever the file allows them.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

PNG options here: browser or advanced encoder; RGBA, RGB, grayscale or indexed color; 8- or 16-bit; Fast, Balanced or Maximum compression; interlacing. Which PNG settings are worth changing?

How it works
  1. The .ktx header is read for its format label
  2. The tiles are unpacked as that label says
  3. The pixels are saved as a PNG

What it does

The label decides

A DXT1 texture labelled RGBA keeps its clear pixels. One labelled RGB shows them black.

Clear pixels in the PNG of our RGBA-labelled test file: 17,575 pixels

For .ktx files

This page reads KTX 1 textures. A .ktx2 texture goes to the KTX2 to PNG page.

Limits One flat picture per file: KTX 1 cube maps, arrays and 3D textures are refused.

Why did your KTX texture's clear corners turn black?

One label in the file's header decides it. The same DXT1 data comes out see-through or black, depending on what the KTX says it is.

Where did the see-through corners go?

A KTX texture from an OpenGL program or a 3D asset pack can hold a cut-out: a leaf, a fence, a sign with its corners clear. If the PNG comes back with those corners solid black, the picture inside may be fine. What decides the black is one label in the file's header. This page is about the older KTX 1 files, the ones ending in .ktx; a .ktx2 file has a page of its own.

In a texture packed as DXT1, the picture is cut into tiles of 4 by 4 pixels, and each tile keeps a list of four colors to pick from. A tile with clear pixels lists only three real colors and points its clear pixels at the fourth slot. Microsoft's description of the format calls that slot transparent. But a KTX 1 file names its format with a number in its header, and DXT1 has two such numbers, or labels: RGBA DXT1, which allows see-through pixels, and RGB DXT1, which doesn't. FluffyBench reads the slot as the label says, so under the RGB one it's plain black.

The Earth on a checkerboard, the corners around the planet see-through.

Labelled RGBA DXT1

The same Earth on a solid black square.

Labelled RGB DXT1

The same DXT1 tiles of a 256-pixel Earth in two test KTX 1 files. On the left, the file labelled RGBA; on the right, the one labelled RGB. How we measured · Photo: NASA, Public domain, NASA-created image, via Wikimedia Commons.

On our test files the 17,575 pixels that were clear under the RGBA label all came out black under the RGB one, and every other pixel matched exactly.

Can you get the clear corners back?

Not by converting again, since the converter reads the file as its label says. In the PNG, though, the black is easy to find. Every one of those pixels is exactly black, 0 for red, green and blue, so selecting that one color in an image editor picks them out, together with any pure black the picture itself had.

A texture you make with FluffyBench won't have this problem. When the KTX converter writes DXT1, it uses the RGBA label, so FluffyBench reads its clear pixels back as clear.

Saving a KTX 1 texture as a PNG

A PNG keeps see-through pixels with no setting to change, so PNG's defaults are right for a cut-out.

  1. Add the .ktx through Choose images.

  2. Press Convert 1 to PNG.

  3. Look at the preview on the finished card before you download: black where you expected see-through means the file is labelled RGB.

    The finished PNG of the Earth test texture labelled RGB DXT1, the planet on a black square, with the download arrow outlined.
    The finished PNG of the Earth test texture labelled RGB DXT1, the planet on a black square, with the download arrow outlined.

What if the file or the job is a different one?

Your texture ends in .ktx2, not .ktx.

FluffyBench's KTX2 to PNG converter

KTX2 is the newer format with its own ways of packing a picture, and its own converter page.

You've cleaned up the PNG and need a KTX texture again.

FluffyBench's KTX and KTX2 converter

Swap its From and To, then add the PNG.

The converter refuses your .ktx outright.

FluffyBench's KTX to WebP converter

Its page explains which ways of packing a KTX 1 texture the converter can't unpack.

Search FluffyBench