mcraiha / libktxsharp

Managed C# library for handling KTX File Format
The Unlicense
9 stars 3 forks source link

hi, how to convert ktx to bitmap/some other common image types #1

Open Jakvic opened 5 years ago

mcraiha commented 5 years ago

In general, I would suggest something like Mali Texture Compression Tool

If you have to use libktxsharp then you can get resolution from header and create a bitmap or a memory array of those dimensions. Then if the texture data is not compressed, you might be able to copy data from textureDataOfMipmapLevel to your structure (assuming that pixel format matches).

Jakvic commented 5 years ago

the ktx files are compressed, and I will use lzfse to decompress them,and then read them. But it is not yet complete

Jakvic commented 5 years ago

hi, now, I can compressing the ktx file and read them into a byte[], The size of the buffers is different, i do not know where should I copy form the buffer of textureDataOfMipmapLevel ktxq