如下所示:
from PIL import Image
import numpy as np
# 反相
# a = np.array(Image.open("test.jpg"))
# b = [255, 255, 255] - a
# 灰度,反相
# a = np.array(Image.open("test.jpg").convert('L'))
# b = 255 - a
# 灰度,颜色变谈
# a = np.array(Image.open("test.jpg").convert('L'))
# b = (100/255)*a + 150 # 区间压缩再增加
# 灰度,颜色加重
#
2024-02-23 17:20:41
35KB
numpy
1