[Python] python通过pil将图片转换成黑白效果 →→→→→进入此内容的聊天室

来自 , 2021-03-11, 写在 Python, 查看 110 次.
URL http://www.code666.cn/view/5c971edc
  1. from PIL import Image
  2. # http://www.sharejs.com
  3. image_file = Image.open("convert_image.png") # open colour image
  4. image_file = image_file.convert('1') # convert image to black and white
  5. image_file.save('result.png')
  6. #//python/8729

回复 "python通过pil将图片转换成黑白效果"

这儿你可以回复上面这条便签

captcha