nowwe can write the same image into the other formatsay png by using the imwrite(functioncv imwrite('image_flower png',imagethe output true means that the image has been successfully written as png file also in the same folder true notethe function destroyallwindows(simply destroys all the windows we created color space conversion in opencvthe images are not stored by using the conventional rgb colorrather they are stored in the reverse order in the bgr order hence the default color code while reading an image is bgr the cvtcolor(color conversion function in for converting the image from one color code to other example consider this example to convert image from bgr to grayscale import the opencv package as shownimport cv nowfor reading particular imageuse the imread(functionimage cv imread('image_flower jpg'nowif we see this image using imshow(functionthen we can see that this image is in bgr