Skip to content

Commit

Permalink
Merge pull request #2 from radarhere/autocontrast_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elejke committed Mar 29, 2021
2 parents 9ea20c0 + 7844c6e commit b855d75
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/test_imageops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit b855d75

Please sign in to comment.