import cv2
img = cv2.imread('image.png')
if img is not None:
print("Image successfully read.")
else:
print("Failed")
# cv2.imshow("Image",img)
# cv2.waitKey(0) #destroys the window when any key is pressed.
# #save the image with new name:
# newname = input("Enter the new name with extension: ")
# if(newname ==None):
# print("Please enter name")
# elif(not(newname.endswith('jpg') or newname.endswith('webp') or
newname.endswith('png'))):
# print("Give extension!")
# else:
# cv2.imwrite(newname,img)
# print("Image saved successfully..")
# width = int(input("Enter width: "))
# height = int(input("Enter Height: "))
# resized_img = cv2.resize(img,(width,height))
# cv2.imshow("Resized Image",resized_img)
# cv2.waitKey(0)
# if img is None:
# print("No img")
# else:
# flipped_img = cv2.flip(img,0)
# cv2.imshow("Flipped Image",flipped_img)
# cv2.waitKey(0)
# x = 114
# y=214
# w=400
# h=233
# cropped_img = img[y:y+h, x:x+w]
# cv2.imshow("Cropped img", cropped_img)
# cv2.waitKey(0)
# gray_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# cv2.imshow("gray",gray_img)
# cv2.waitKey(0)
# alpha = 3.3
# img2 = cv2.convertScaleAbs(img,alpha=alpha,beta=0)
# cv2.imshow("sd",img2)
# cv2.waitKey(0)