Skip to content

Commit

Permalink
Use quantization method attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 22, 2021
1 parent aa35f6b commit 4e0bc3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PIL/Image.py
Expand Up @@ -1074,11 +1074,11 @@ def quantize(self, colors=256, method=None, kmeans=0, palette=None, dither=1):

if method is None:
# defaults:
method = 0
method = MEDIANCUT
if self.mode == "RGBA":
method = 2
method = FASTOCTREE

if self.mode == "RGBA" and method not in (2, 3):
if self.mode == "RGBA" and method not in (FASTOCTREE, LIBIMAGEQUANT):
# Caller specified an invalid mode.
raise ValueError(
"Fast Octree (method == 2) and libimagequant (method == 3) "
Expand Down

0 comments on commit 4e0bc3b

Please sign in to comment.