里昂·拉维(Liron Lavi)
这是我的代码:
img = cv2.imread(some_path, 0)
原始图片:
运行代码后:
显然失去了很多透明度。
阿达帕
您可以使用PILLOW:
from PIL import Image
img = Image.open('image_to_grayscale.png').convert('LA')
img.save('greyscale.png')
结果:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
编辑于
我来说两句