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

在图像模块Python中将BMP转换为灰度,python,image,Python,Image,我想知道如何使用Python的图像模块将BMP转换为灰度? 谢谢灰度图像模式已启用 >>> import Image >>> Image.open('input.bmp').convert('L').save('output.bmp')

我想知道如何使用Python的图像模块将BMP转换为灰度? 谢谢

灰度图像模式已启用

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