使用python PIL将RGB图像转换为纯黑白图像

2019-02-27  本文已影响0人  虚心的锄头
from PIL import Image 
image_file = Image.open("convert_image.png") # open colour image
image_file = image_file.convert('1') # convert image to black and white
image_file.save('result.png')
上一篇 下一篇

猜你喜欢

热点阅读