Merge pull request #2 from radarhere/autocontrast_tests

This commit is contained in:
German Novikov 2021-03-29 16:01:51 +03:00 committed by GitHub
commit b855d759cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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():
gradient = Image.linear_gradient("L")