def change_color(image, color=1.0):
"""
Change color of image.
>>> image = np.eye(3, dtype='uint8') * 255
>>> change_color(image, 0.5)
array([[255, 0, 0],
[ 0, 255, 0],
[ 0, 0, 255]], dtype=uint8)
See
http://pillow.readthedocs.io/en/3.1.x/reference/ImageEnhance.html#PIL.ImageEnhance.Color
:param numpy array image: Numpy array with range [0,255] and dtype 'uint8'.
:param float color: Color [0, 1]
:return: Image with changed color
:rtype: numpy array with range [0,255] and dtype 'uint8'
"""
return enhance(image, ie.Color, color)
评论列表
文章目录