1import cv2
2
3img = cv2.imread('/home/img/python.png', cv2.IMREAD_UNCHANGED)
4
5print('Original Dimensions : ', img.shape)
6
7scale_percent = 60 # percent of original size
8width = int(img.shape[1] * scale_percent / 100)
9height = int(img.shape[0] * scale_percent / 100)
10dim = (width, height)
11# resize image
12resized = cv2.resize(img, dim, interpolation = cv2.INTER_AREA)
13
14print('Resized Dimensions : ',resized.shape)
15
16cv2.imshow("Resized image", resized)
17cv2.waitKey(0)
18cv2.destroyAllWindows()