O'Reilly logo

Computer Vision with Python 3 by Saurabh Kapur

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing or saving an image

To write or save an image to a file on your computer, use the save() function associated to the image object. It takes in the absolute or relative file path to where you want to store the image:

>>> img.save("temp.png") # Example showing relative path>>> img.save("/tmp/temp.png") # Example showing absolute path

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required