美文网首页
使用python PIL将RGB图像转换为纯黑白图像

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

作者: 虚心的锄头 | 来源:发表于2019-02-27 09:45 被阅读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')
    

    相关文章

      网友评论

          本文标题:使用python PIL将RGB图像转换为纯黑白图像

          本文链接:https://www.haomeiwen.com/subject/jxkxuqtx.html