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')
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')
本文标题:使用python PIL将RGB图像转换为纯黑白图像
本文链接:https://www.haomeiwen.com/subject/jxkxuqtx.html
网友评论