简体   繁体   English

在图像模块Python中将BMP转换为灰度

[英]Converting BMP to Grey Scale in Image Module Python

I was wondering how I can convert BMPs to a grey scale using Image Module of Python? 我想知道如何使用Python的图像模块将BMP转换为灰度? Thanks 谢谢

Greyscale image mode is 'L' . 灰度图像模式为'L'

>>> import Image
>>> Image.open('input.bmp').convert('L').save('output.bmp')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM