mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-13 09:15:46 +03:00
added assert for midpoint range
This commit is contained in:
parent
adf570a77e
commit
3c6fd275c8
|
@ -154,10 +154,11 @@ def colorize(image, black, white, mid=None, midpoint=128):
|
|||
:param black: The color to use for black input pixels.
|
||||
:param white: The color to use for white input pixels.
|
||||
:param mid: The color to use for midtone input pixels.
|
||||
:param midpoint: the int value [0, 255] for the mid color.
|
||||
:param midpoint: the int value in [1, 254] for the mid color.
|
||||
:return: An image.
|
||||
"""
|
||||
assert image.mode == "L"
|
||||
assert 1 <= midpoint <= 254
|
||||
|
||||
# Define colors from arguments
|
||||
black = _color(black, "RGB")
|
||||
|
|
Loading…
Reference in New Issue
Block a user