Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 3f2a179

Browse files
committed
reduce_img_size
1 parent 63176e2 commit 3f2a179

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

projects/Reduce_image_file_size/README.md

Whitespace-only changes.
603 KB
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import cv2
2+
3+
img = cv2.imread('input.jpg')
4+
5+
print(img.shape)
6+
7+
# rescalling image
8+
width = int((img.shape[1])/5)
9+
height = int((img.shape[0])/5)
10+
11+
scaled = cv2.resize(img, (width, height), interpolation=cv2.INTER_AREA)
12+
13+
print(scaled.shape)
14+
15+
cv2.imshow("Output",scaled)
16+
cv2.waitKey(500)
17+
cv2.destroyAllWindows()
18+
19+
cv2.imwrite('resized_output_image.jpg',scaled)
20+
46.9 KB
Loading

0 commit comments

Comments
 (0)