The result must be a new image with the same dimensions as img. The value of each pixel in the new image should be the result of applying func to the corresponding pixel of img. Use either code example
Example: function to red image in p
# importing OpenCV(cv2) module
import cv2
# Save image in set directory
# Read RGB image
img = cv2.imread('g4g.png')
# Output img with window name as 'image'
cv2.imshow('image', img)
# Maintain output window utill
# user presses a key
cv2.waitKey(0)
# Destroying present windows on screen
cv2.destroyAllWindows()