This tests the functionality of the read-write Javascript binding for libktx, which has been compiled to Javascript using Emscripten. Though loosely referred to as "write" the added functionalty tested here is more about creating ktxTexture objects from scratch than writing them out as files.
Click the Run Tests button to run the tests.
The test reads a .png file then performs various operations using the wrapper API including creating an uncompressed ktxTexture2 object. The operations are shown in the list below.
Create uncompressed ktxTexture2:
Copy input image to new texture:
Check oetf and primaries are set correctly:
Write and read metadata:
Get image from new texture:
Create copy of original texture:
Compress ktxTexture2 with Basis:
Write KTX file to memory:
Read KTX file from memory:
ASTC inputSwizzle set:
Compress ktxTexture2 with ASTC: