adding new files

This commit is contained in:
Richard Geldreich
2026-01-19 01:59:35 -05:00
parent 9d87991078
commit ea6778b2b5
72 changed files with 31686 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from basisu_py import Transcoder
from PIL import Image
import numpy as np
# Load input file
with open("test.ktx2", "rb") as f:
data = f.read()
# Decode (AUTO backend)
t = Transcoder()
rgba = t.decode_rgba(data) # returns HxWx4 uint8 NumPy array
print("Decoded:", rgba.shape, rgba.dtype)
# Convert to Pillow Image and save
img = Image.fromarray(rgba, mode="RGBA")
img.save("decoded.png")
print("Wrote decoded.png")