Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tilequant/legacy/image_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def __init__(
self._img = img.convert("RGB")
self._tile_width = tile_width
self._tile_height = tile_height
self._transparent_color = transparent_color
self._transparent_color = (
transparent_color[0],
transparent_color[1],
transparent_color[2],
)
self._reset(0, 0, 0, NONE, 0, False, False)

# noinspection PyAttributeOutsideInit
Expand Down Expand Up @@ -437,10 +441,8 @@ def _build_image(self, indexed_pixels, palettes):
# Fill rest of palette
p = list(p)
p.extend([(0, 0, 0)] * (self._colors_per_palette - len(p)))
for r, g, b in p:
cols.append(r)
cols.append(g)
cols.append(b)
for item in p:
cols.extend([item[0], item[1], item[2]])
for i in range(processed_palette_count, self._num_palettes):
cols += [0] * 3 * self._colors_per_palette
im.putpalette(cols)
Expand Down
Loading