mirror of
https://github.com/python-pillow/Pillow.git
synced 2026-02-05 14:59:32 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
8cb0ce545f
commit
7b59e6f6b3
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user