Skip to content

Commit

Permalink
Merge pull request #5353 from radarhere/quantize_attributes
Browse files Browse the repository at this point in the history
Use quantization method attributes
  • Loading branch information
hugovk committed Mar 27, 2021
2 parents 3addd7d + 4e0bc3b commit 5e1d304
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PIL/Image.py
Expand Up @@ -1080,11 +1080,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 5e1d304

Please sign in to comment.