python通过pil将图片转换成黑白效果的方法
2015-03-16 12:10
1141 查看
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通过pil模块将raw图片转换成png图片的方法
- python实现通过pil模块对图片格式进行转换的方法
- python通过pil模块获得图片exif信息的方法
- python通过pil为png图片填充上背景颜色的方法
- Python通过PIL获取图片主要颜色并和颜色库进行对比的方法
- Python通过PIL获取图片主要颜色并和颜色库进行对比的方法
- Python3.4 tkinter,PIL图片转换(GUI)
- Python使用PIL库实现验证码图片的方法
- Python使用PIL库实现验证码图片的方法
- Python输出汉字字库及将文字转换为图片的方法
- Python输出汉字字库及将文字转换为图片的方法
- JavaScript将base64图片转换成formData并通过AJAX提交的实现方法
- python中利用PIL(Python Image Library) 将矩阵转换为图片
- 【Python3/PIL】编辑图片的常用方法
- Python将图片转换为字符画的方法
- Python3.4 tkinter,PIL图片转换
- JavaScript+Canvas实现彩色图片转换成黑白图片的方法分析
- python将.ppm格式图片转换成.jpg格式文件的方法
- python将图片文件转换成base64编码的方法