def _apply_palette(self, image):
if isinstance(self._pixel_shader, Palette):
image.putpalette(
def _apply_palette(self, image):
if isinstance(self._pixel_shader, Palette):
image.putpalette(
if isinstance(self._pixel_shader, ColorConverter):
# This will be needed for eInks, grayscale, and monochrome displays
pass
def _add_alpha(self, image):
if isinstance(self._pixel_shader, Palette):
if isinstance(self._pixel_shader, ColorConverter):
# This will be needed for eInks, grayscale, and monochrome displays
pass
def _add_alpha(self, image):
if isinstance(self._pixel_shader, Palette):
tile_index = self._tiles[tile_y * self._width + tile_x]
tile_index_x = tile_index % tile_count_x
tile_index_y = tile_index // tile_count_x
tile_index = self._tiles[tile_y * self._width + tile_x]
tile_index_x = tile_index % tile_count_x
tile_index_y = tile_index // tile_count_x
self._apply_palette(tile_image)
tile_image = tile_image.convert("RGBA")
self._add_alpha(tile_image)
self._apply_palette(tile_image)
tile_image = tile_image.convert("RGBA")
self._add_alpha(tile_image)