Saving image in python
<p>I'm new to python. What I want to do is to read in an image, convert it to gray value and save it.</p>

<p>This is what I have so far:</p>

<pre><code># 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
</code></pre>

<p>Now my problem is how to save it. As far as I unterstood there are a lot of different modules (Using python 2.7) Could someone give my an example?</p>

<p>Thanks</p>

<p>I don't know what you mean about "lots of different modules". You're presumably using Pillow; you opened the image via <code>Image.open</code> and assigned the converted image to <code>im_grey</code>, so now you have an instance of Image which has <a href="http://pillow.readthedocs.io/en/3.4.x/reference/Image.html#PIL.Image.Image.save" rel="nofollow">a save method</a>:</p>

<pre><code>im_grey.save('path/to/new/filename')
</code></pre>

python image save