The optimization algorithm is only applicable to the image of mode="P".

This commit is contained in:
Moriyoshi Koizumi 2014-11-06 12:18:41 +09:00
parent 4a8471dea1
commit 53de81f0a1

View File

@ -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