Skip to content

Commit

Permalink
Use enums for quantize instead of raw values
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 18, 2022
1 parent af34535 commit f6e0242
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/test_image_quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_quantize_no_dither():
with Image.open("Tests/images/caption_6_33_22.png") as palette:
palette = palette.convert("P")

converted = image.quantize(dither=0, palette=palette)
converted = image.quantize(dither=Image.Dither.NONE, palette=palette)
assert converted.mode == "P"
assert converted.palette.palette == palette.palette.palette

Expand All @@ -70,8 +70,8 @@ def test_quantize_dither_diff():
with Image.open("Tests/images/caption_6_33_22.png") as palette:
palette = palette.convert("P")

dither = image.quantize(dither=1, palette=palette)
nodither = image.quantize(dither=0, palette=palette)
dither = image.quantize(dither=Image.Dither.FLOYDSTEINBERG, palette=palette)
nodither = image.quantize(dither=Image.Dither.NONE, palette=palette)

assert dither.tobytes() != nodither.tobytes()

Expand Down

0 comments on commit f6e0242

Please sign in to comment.