Skip to content

Commit

Permalink
Do not require mapping palette to have 256 entries
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Aug 28, 2022
1 parent 9fa4219 commit c9c190e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Expand Up @@ -1901,7 +1901,7 @@ def remap_palette(self, dest_map, source_palette=None):
source_palette = bytearray(i // 3 for i in range(768))

palette_bytes = b""
new_positions = [0] * 256
new_positions = [0] * min(256, max(dest_map) + 1)

# pick only the used colors from the palette
for i, oldPosition in enumerate(dest_map):
Expand Down

0 comments on commit c9c190e

Please sign in to comment.