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/saving the image

The imwrite() function can be used to save the image to the disk. It takes the image name and the image matrix as input. The following is an example of writing an image:

>>> import cv2>>> img = cv2.imread("image.jpg")>>> cv2.imwrite("saved_image.jpg", img)

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