readingwriting and displaying an image most of the cv applications need to get the images as input and produce the images as output in this sectionyou will learn how to read and write image file with the help of functions provided by opencv opencv functions for readingshowingwriting an image file opencv provides the following functions for this purposeimread(functionthis is the function for reading an imread(supports various image formats like pngjpegimage opencv jpgtiffetc imshow(functionthis is the function for showing an image in window the window automatically fits to the image size opencv imshow(supports various image formats like pngjpegjpgtiffetc imwrite(functionthis is the function for writing imwrite(supports various image formats like pngan image opencv jpegjpgtiffetc example this example shows the python code for reading an image in one formatshowing it in window and writing the same image in other format consider the steps shown belowimport the opencv package as shownimport cv nowfor reading particular imageuse the imread(functionimage cv imread('image_flower jpg'for showing the imageuse the imshow(function the name of the window in which you can see the image would be image_flower cv imshow('image_flower',imagecv destroyallwindows(