Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/image_resize/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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 added scripts/image_resize/resize image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions scripts/image_resize/resize_image.py
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions scripts/image_resize/tempCodeRunnerFile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
matplotlib.pyplot