Skip to content

Commit 77e31b2

Browse files
committed
feat: Added image resizer program
1 parent 903bbec commit 77e31b2

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Image Compression/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import cv2
2+
3+
img = cv2.imread('input.jpg')
4+
print(img.shape)
5+
6+
k = 5
7+
width = int((img.shape[1])/k)
8+
height = int((img.shape[0])/k)
9+
10+
scaled = cv2.resize(img, (width, height), interpolation=cv2.INTER_AREA)
11+
print(scaled.shape)
12+
13+
cv2.imshow("Output", scaled)
14+
cv2.waitKey(500)
15+
cv2.destroyAllWindows()
16+
17+
cv2.imwrite('resized_image.jpg', scaled)

Image Compression/requirements.txt

50 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)