Skip to content

Commit eade40f

Browse files
committed
feat: Added image reducer program.
1 parent 81ec453 commit eade40f

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

ImageSize Reducer/reduce.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('test.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_Image", scaled)
14+
cv2.waitKey(500)
15+
cv2.destroyAllWindows()
16+
17+
cv2.imwrite('resized_image.jpg', scaled)

ImageSize Reducer/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
opencv-python

0 commit comments

Comments
 (0)