mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-08 06:14:45 +03:00
The optimization algorithm is only applicable to the image of mode="P".
This commit is contained in:
parent
4a8471dea1
commit
53de81f0a1
|
@ -433,7 +433,7 @@ def getheader(im, palette=None, info=None):
|
|||
|
||||
usedPaletteColors = paletteBytes = None
|
||||
|
||||
if optimize:
|
||||
if im.mode == "P" and optimize:
|
||||
usedPaletteColors = []
|
||||
|
||||
# check which colors are used
|
||||
|
|
Loading…
Reference in New Issue
Block a user