【发布时间】:2016-10-17 08:44:46
【问题描述】:
我是 python 新手。我要做的是读取图像,将其转换为灰度值并保存。
这是我目前所拥有的:
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="Path to the image")
args = vars(ap.parse_args())
#Greyvalue image
im = Image.open(args["image"])
im_grey = im.convert('LA') # convert to grayscale
现在我的问题是如何保存它。据我了解,有很多不同的模块(使用 python 2.7)有人可以举个例子吗?
谢谢
【问题讨论】:
-
这和处理语言有关系吗?