Skip to content

Commit

Permalink
Changed quantize default dither to FLOYDSTEINBERG
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 18, 2022
1 parent f6e0242 commit 7538864
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/PIL/Image.py
Expand Up @@ -1123,7 +1123,14 @@ def convert_transparency(m, v):
new_im.info["transparency"] = trns
return new_im

def quantize(self, colors=256, method=None, kmeans=0, palette=None, dither=1):
def quantize(
self,
colors=256,
method=None,
kmeans=0,
palette=None,
dither=Dither.FLOYDSTEINBERG,
):
"""
Convert the image to 'P' mode with the specified number
of colors.
Expand All @@ -1148,7 +1155,6 @@ def quantize(self, colors=256, method=None, kmeans=0, palette=None, dither=1):
mode "RGB" to "P" or from "RGB" or "L" to "1".
Available methods are :data:`Dither.NONE` or :data:`Dither.FLOYDSTEINBERG`
(default).
Default: 1 (legacy setting)
:returns: A new image
"""
Expand Down

0 comments on commit 7538864

Please sign in to comment.