Uploaded June 2017 | Updated September 2026, 2 weeks ago
This is a fully explanation video tutorial how to create Real World Python application that perform Batch (multiple) image resizing for current folder.
For that following Python modules must be used:
cv2 - for image processing
glob - finds all the path names matching a specified pattern according to the rules.
The content of this video tutorial is:
0:04 - presenting real situation
0:20 - creating a Python project file
1. 0:34 - import glob and cv2 modules to the project
2. 0:48 - create a list of image (JPG) files that are stored in project folder. Here all image filenames read and stored to Numpy array.
1:17 - create a for loop that read all image files for processing
1:30 - reading all image files from directory (see explanation below)
3. 2:00 -create a variable for a resized (result) file
2:12 - explanation of cv2 resized method
4. 3:22 - define a name of windows that will show result resized image
5. 3:46 - Show result image on window for 0,5 sec.
6. 4:17 - Write and Save resized file as new one!
5:08 - Result!
Explanation to 1:30: presenting all types of reading image file to Python:
0 - graycolor
1 - RBG
-1 - RBG with Alpha channel
If you have any questions, just write it on comments!
Please Subscribe me to get more and more interesting Python tricks and tips!
P.S. glob is a 3rd party Python module. You can check how to install this module here: youtube.com/watch?v=XSp3aLKFKWY
Vytautas.
This is a fully explanation video tutorial how to create Real World Python application that perform Batch (multiple) image resizing for current folder.
For that following Python modules must be used:
cv2 - for image processing
glob - finds all the path names matching a specified pattern according to the rules.
The content of this video tutorial is:
0:04 - presenting real situation
0:20 - creating a Python project file
1. 0:34 - import glob and cv2 modules to the project
2. 0:48 - create a list of image (JPG) files that are stored in project folder. Here all image filenames read and stored to Numpy array.
1:17 - create a for loop that read all image files for processing
1:30 - reading all image files from directory (see explanation below)
3. 2:00 -create a variable for a resized (result) file
2:12 - explanation of cv2 resized method
4. 3:22 - define a name of windows that will show result resized image
5. 3:46 - Show result image on window for 0,5 sec.
6. 4:17 - Write and Save resized file as new one!
5:08 - Result!
Explanation to 1:30: presenting all types of reading image file to Python:
0 - graycolor
1 - RBG
-1 - RBG with Alpha channel
If you have any questions, just write it on comments!
Please Subscribe me to get more and more interesting Python tricks and tips!
P.S. glob is a 3rd party Python module. You can check how to install this module here: youtube.com/watch?v=XSp3aLKFKWY
Vytautas.










