Please conduct a python code for the following, please follow the…

Question Answered step-by-step Please conduct a python code for the following, please follow the… Please conduct a python code for the following, please follow the instruction exactly how it is said.  For this coding challenge you will be performing an image transformation to crop the given image. This filter takes an image along with the top_left coordinate, width, and height and returns a cropped version of the input image starting at the top_left coordinate with the given height (the number of rows) and the given width (number of columns) . You’re required to create a copy of the image before modifying it and ensure that the original image remains as it is. Function Name: crop_imageParameters:img – The image represented as a 2D list of tuplestop_left – The (row, col) tuple coordinate of the upper left of the region from where to begin the cropc_height – A positive integer representing the height of the cropped imagec_width – A positive integer representing the width of the cropped image.Note: You should add these parameters in the exact same order as given aboveReturn: A cropped version of the given image starting from the top_left coordinate to the given c_height and c_width values Example Result:Before…After applying the crop_image on the above image with the following arguments,top_left = (0,0) c_height = 350 c_width = 350Handling Edge Cases: You should handle these edge cases as follows:If the value of c_height or c_width is negative (e.g., c_height = -100 or c_width = -200), then your function should not perform any cropping and return a copy of the original image. In this case, your function should also print the following error message: “The c_height or c_width of the cropped image is negative!”If the top_left is outside the bounds of the image (e.g., top_left = (800, 1200) in a 600 x 800 image), then your function should not perform any cropping and return a copy of the original image. In this case, your function should also print the following error message: “The top_left value is not within the bounds of the original image!”If the height or width of the cropped image is outside the bounds of the original image (i.e., top_left[0] + c_height > height (img) or top_left[1] + c_width > width(img) ), then your function should not perform any cropping and return a copy of the original image. In this case, your function should also print the following error message: “The height or width of the cropped image is greater than the original image!”NOTE: You should handle the above edge cases in the same order shown above. For example, if c_width = -100 and top_left = (800, 1200), then your program should just print “The c_height or c_width of the cropped image is negative!” and return a copy of the original image although the top_left is out of bounds. Computer Science Engineering & Technology Python Programming CSE 8a Share QuestionEmailCopy link Comments (0)