mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Test that preserve_tone changes RGB images but not L images
This commit is contained in:
parent
9ea20c095e
commit
7844c6e483
|
@ -365,6 +365,15 @@ def test_autocontrast_mask_real_input():
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_autocontrast_preserve_tone():
|
||||||
|
def autocontrast(mode, preserve_tone):
|
||||||
|
im = hopper(mode)
|
||||||
|
return ImageOps.autocontrast(im, preserve_tone=preserve_tone).histogram()
|
||||||
|
|
||||||
|
assert autocontrast("RGB", True) != autocontrast("RGB", False)
|
||||||
|
assert autocontrast("L", True) == autocontrast("L", False)
|
||||||
|
|
||||||
|
|
||||||
def test_autocontrast_preserve_gradient():
|
def test_autocontrast_preserve_gradient():
|
||||||
gradient = Image.linear_gradient("L")
|
gradient = Image.linear_gradient("L")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user