KTX Image: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
imported>Ikskoks
 
(44 intermediate revisions by the same user not shown)
Line 1: Line 1:
== KTX ==  
== KTX, KTX2 ==  


* ''' Format Type ''':    Image <br>  
* ''' Format Type ''':    Image <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian or Big Endian<br>
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian or Big Endian<br>
* ''' Signatures ''':    KTX 11 / KTX 20 <br>




=== Format Specifications (KTX v1.1) ===  
=== Format Specifications (KTX v1.1) ===  
This file format is no longer used in newer games. It was replaced by KTX v2.0.
KTX v1.1 file format is no longer used in newer games. It was replaced by KTX v2.0.
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;">
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;">
<pre>
<pre>
Line 108: Line 109:
Full file format description can be found in official documentation [https://github.khronos.org/KTX-Specification/ here].
Full file format description can be found in official documentation [https://github.khronos.org/KTX-Specification/ here].


=== MultiEx BMS Script ===  
=== Notes and Comments ===  


Not written yet.
None.
 
=== Notes and Comments ===


* This is KTX image file format.
=== Games ===
List of games using this file format:
* Lord of the Rings: Rise of War
* Miniverse


=== Compatible Programs ===  
=== Compatible Programs ===  


* [https://github.com/BinomialLLC/crunch crunch]
* [https://github.com/BinomialLLC/crunch crunch]
* GIMP + [https://github.com/chriku/gimp-ktx gimp-ktx plugin]
* [https://github.com/kopaka1822/ImageViewer Image Viewer and Tonemapper] (can view KTX/KTX2 files)
* [https://github.com/alecazam/kram Kram] (can view KTX/KTX2 files)
* [https://github.com/KhronosGroup/KTX-Software KTX-Software] (official tools to create KTX/KTX2 files)
* [http://pixelandpolygon.com/picopixel-download PicoPixel] (can view KTX files)
* PVRTexTool
=== See Also ===
* [https://github.com/KhronosGroup/KTX-Specification KTX-Specification] (official KTX file format repository on Github)
* [https://web.archive.org/web/20140219231709/https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX 1.1 file format]
* [https://github.com/KhronosGroup/KTX-Software/wiki KTX Software Wiki]
=== Gallery ===
<gallery bordercolor="transparent" spacing="small" orientation="landscape">
ktx_picopixel.png|KTX file opened in PicoPixel
</gallery>
<br/><br>
<br/><br>


Line 127: Line 146:
[[Category:Format_Image | Type: Image]]
[[Category:Format_Image | Type: Image]]
[[Category:Extension_ktx | Extension: ktx]]
[[Category:Extension_ktx | Extension: ktx]]
[[Category:Extension_ktx2 | Extension: ktx2]]
[[Category:BMS_None | BMS: None]]
[[Category:BMS_None | BMS: None]]
[[Category:File Format]]
[[Category:File Format]]

Latest revision as of 20:54, 28 September 2022

KTX, KTX2

  • Format Type : Image
  • Endian Order : Little Endian or Big Endian
  • Signatures : KTX 11 / KTX 20


Format Specifications (KTX v1.1)

KTX v1.1 file format is no longer used in newer games. It was replaced by KTX v2.0.

// KTX 1.1 texture 
// Khronos Texture file format


// header (64 bytes)
12 bytes - magic  // "AB 4B 54 58 20 31 31 BB 0D 0A 1A 0A"  (KTX 11)
4 bytes (uint32) - endianess  // "01 02 03 04" - little endian
                              // "04 03 02 01" - big endian
4 bytes (uint32) - gl type  // can be "0"
4 bytes (uint32) - type size  // "1"
4 bytes (uint32) - gl format  // "0"
4 bytes (uint32) - gl internal format
4 bytes (uint32) - gl base internal format
4 bytes (uint32) - pixel width
4 bytes (uint32) - pixel height
4 bytes (uint32) - pixel depth
4 bytes (uint32) - number of array elements
4 bytes (uint32) - number of faces
4 bytes (uint32) - number of mipmap levels
4 bytes (uint32) - size of key value data


// key and value data
num_of_key_value_entries *
{
   4 bytes (uint32) - size of key value entry
   x bytes - key value entry  // e.g. "KTXorientation.S=r,T=d,R=i"
   x bytes - padding
}


num_of_mipmap_levels *
{
   4 bytes (uint32) - image data size
   x bytes - image data
}

x bytes - padding

Full file format description can be found in official documentation here.

Format Specifications (KTX v2.0)

// KTX 2.0 texture 
// Khronos Texture file format


// header
12 bytes - magic  // "AB 4B 54 58 20 32 30 BB 0D 0A 1A 0A"  (KTX 20)
4 bytes (uint32) - vulkan format
4 bytes (uint32) - type size
4 bytes (uint32) - pixel width
4 bytes (uint32) - pixel height
4 bytes (uint32) - pixel depth
4 bytes (uint32) - layer count
4 bytes (uint32) - face count
4 bytes (uint32) - level count
4 bytes (uint32) - super compression scheme

// index
4 bytes (uint32) - dfd byte offset
4 bytes (uint32) - dfd byte length
4 bytes (uint32) - kvd byte offset
8 bytes (uint64) - sgd byte offset
8 bytes (uint64) - sgd byte length

// level index
num_of_levels *
{
   8 bytes (uint64) - byte offset
   8 bytes (uint64) - byte length
   8 bytes (uint64) - uncompressed byte length   
}


// data format descriptor
4 bytes (uint32) - dfd total size
x bytes - dfd block


// key value data
4 bytes (uint32) - key and value byte length
x bytes - key and value data
x bytes - padding


// super compression global data
x bytes - super compression data

// image data
x bytes - data

Full file format description can be found in official documentation here.

Notes and Comments

None.

Games

List of games using this file format:

  • Lord of the Rings: Rise of War
  • Miniverse

Compatible Programs

See Also

Gallery