1
0
Fork 0

More test images

main
Andrew Cassidy 3 years ago
parent 0ade526dd1
commit 1023b49344

1
.gitattributes vendored

@ -1,2 +1,3 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.afdesign filter=lfs diff=lfs merge=lfs -text
*.dds filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored

@ -0,0 +1 @@
__pycache__

@ -1,17 +1,20 @@
from PIL import Image
import os
from collections import namedtuple
from quicktex.s3tc.bc1 import BC1Block
from quicktex import RawTexture
import os.path
image_path = os.path.dirname(os.path.realpath(__file__))
class Blocks:
# A block that should always encode greyscale, where every row of pixels is identical, and the left side is lighter than the right side
greyscale = Image.open(image_path + "/blocks/greyscale.png").tobytes("raw", "RGBX")
class BC1Blocks:
class Entry:
def __init__(self, filename, block):
path = os.path.join(image_path, 'blocks', filename)
self.image = Image.open(path).convert('RGBA')
self.texture = RawTexture.frombytes(self.image.tobytes('raw', 'RGBA'), *self.image.size)
self.block = block
# A block that should always encode 3-color when available.
# from left to right: red, yellow, yellow, green
three_color = Image.open(image_path + "/blocks/3color.png").tobytes("raw", "RGBX")
# A block that should always encode 3-color with black when available
# from left to right: black, red, yellow, green
three_color_black = Image.open(image_path + "/blocks/3color black.png").tobytes("raw", "RGBX")
greyscale = Entry('greyscale_unpacked.png', BC1Block.frombytes(b'\xFF\xFF\x49\x4A\x78\x78\x78\x78'))
three_color = Entry('3color_unpacked.png', BC1Block.frombytes(b'\xE0\x07\x00\xF8\x29\x29\x29\x29'))
three_color_black = Entry('3color_black_unpacked.png', BC1Block.frombytes(b'\xE0\x07\x00\xF8\x27\x27\x27\x27'))

BIN
blocks/3color.dds (Stored with Git LFS)

Binary file not shown.

BIN
blocks/3color_black.dds (Stored with Git LFS)

Binary file not shown.

BIN
blocks/3color_black_unpacked.png (Stored with Git LFS)

Binary file not shown.

BIN
blocks/3color_unpacked.png (Stored with Git LFS)

Binary file not shown.

BIN
blocks/greyscale.dds (Stored with Git LFS)

Binary file not shown.

BIN
blocks/greyscale_unpacked.png (Stored with Git LFS)

Binary file not shown.
Loading…
Cancel
Save