当前位置:天才代写 > tutorial > Python教程 > python通过pil将图片转换成黑白效果

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

2018-05-17 08:00 星期四 所属: Python教程 浏览:450

pil功能强大,convert方法可以轻易的将图片转换,下面的代码可以将图片转换成黑白效果

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

 

    关键字:

[contact-form-7 id="17097" title="form2"]天才代写-代写联系方式