Ratan Bhowmick 9458fceb81
Add files via upload
Image Resizer Using Python
2022-10-29 10:09:35 +05:30

26 lines
581 B
Python

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()