add compression.decode_rle_vram() to decompress RLE data directly to X16's VRAM.

Document the compression library.
This commit is contained in:
Irmen de Jong
2024-11-26 01:47:47 +01:00
parent 2eed75f602
commit bc9683cc54
5 changed files with 106 additions and 12 deletions
+3 -2
View File
@@ -82,7 +82,8 @@ class BitmapImage:
def show(self) -> None:
"""Shows the image on the screen"""
if self.img.mode == "P":
self.img.convert("RGB").convert("P").show()
self.img.show()
# self.img.convert("RGB").convert("P").show()
else:
self.img.show()
@@ -198,7 +199,7 @@ class BitmapImage:
elif bits_per_pixel == 4:
num_colors = 15 if fixed_color_zero else 16
if num_colors==16 and preserve_first_16_colors:
return self.quantize_to(default_colors[:16])
return self.quantize_to(default_colors[:16], 0)
elif bits_per_pixel == 2:
assert preserve_first_16_colors==False, "bpp is too small for 16 default colors"
num_colors = 3 if fixed_color_zero else 4