[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2025-12-12 22:25:12 +00:00
parent 8cb0ce545f
commit 7b59e6f6b3
2 changed files with 4 additions and 1 deletions

View File

@ -605,7 +605,8 @@ def test_autocontrast_preserve_one_color(color: tuple[int, int, int]) -> None:
) # single color 10 cutoff
assert_image_equal(img, out)
from PIL import Image, ImageOps
from PIL import ImageOps
def test_dither_primary_returns_image():

View File

@ -643,6 +643,7 @@ def mirror(image: Image.Image) -> Image.Image:
"""
return image.transpose(Image.Transpose.FLIP_LEFT_RIGHT)
def _dither_saturation(value: float, quadrant: int) -> int:
if value > 233:
return 255
@ -654,6 +655,7 @@ def _dither_saturation(value: float, quadrant: int) -> int:
return 255 if quadrant == 1 else 0
return 0
def dither_primary(image: Image.Image) -> Image.Image:
"""
Reduce the image to primary colors and apply ordered dithering.