mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Simplified code
This commit is contained in:
parent
e7fab6abf4
commit
841ba4a940
|
@ -519,10 +519,7 @@ def _normalize_palette(im, palette, info):
|
|||
used_palette_colors = []
|
||||
for i in range(0, len(source_palette), 3):
|
||||
source_color = tuple(source_palette[i : i + 3])
|
||||
try:
|
||||
index = im.palette.colors[source_color]
|
||||
except KeyError:
|
||||
index = None
|
||||
index = im.palette.colors.get(source_color)
|
||||
if index in used_palette_colors:
|
||||
index = None
|
||||
used_palette_colors.append(index)
|
||||
|
|
Loading…
Reference in New Issue
Block a user