From 4e0bc3bab61124e5c8d29743d77541de052c44d8 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 22 Mar 2021 19:44:56 +1100 Subject: [PATCH] Use quantization method attributes --- src/PIL/Image.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 2e7abfb68..5e9d9a89f 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1074,11 +1074,11 @@ class Image: 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) "