Add files via upload

Image Resizer Using Python
This commit is contained in:
Ratan Bhowmick 2022-10-29 10:09:35 +05:30 committed by GitHub
parent e92ca28198
commit 9458fceb81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,7 @@
Image Resizer Using Python
So, I was working on this one project where I needed to place equal size images. To make it look good.
But doing one picture at a time is such a waste. So, I created this simple script to make this easy for me.
Dependencies
Only dependecy is OpenCV2

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

View File

@ -0,0 +1,25 @@
import cv2
import numpy as np
import matplotlib.pyplot as plt
image = cv2.imread("D:\image.jpg", 1)
# Loading the image
half = cv2.resize(image, (0, 0), fx=0.1, fy=0.1)
bigger = cv2.resize(image, (1050, 1610))
stretch_near = cv2.resize(image, (780, 540),
interpolation=cv2.INTER_NEAREST)
Titles = ["Original", "Half", "Bigger", "Interpolation Nearest"]
images = [image, half, bigger, stretch_near]
count = 4
for i in range(count):
plt.subplot(2, 2, i + 1)
plt.title(Titles[i])
plt.imshow(images[i])
plt.show()

View File

@ -0,0 +1 @@
matplotlib.pyplot