Learn Before
Code

Writing Images (OpenCV)

In OpenCV, you can save an image to disk using the cv2.imwrite() function. This function takes the desired file path (where the file extension determines the output format) and the image array as arguments:

cv2.imwrite('new_img.jpg', img)

This is commonly used to export processed, annotated, or labeled images for further analysis or machine learning applications.

0

1

Updated 2026-07-04

Tags

Python Programming Language

Data Science