Resize Images Easily | Pillow | Python

preview_player
Показать описание
Python is a versatile programming language that can be used for a lot of tasks. In this tutorial we will see how we can resize images with Python.
We will use the popular library Pillow for this. Pillow is a fork of the erstwhile PIL library for image manipulation.
In this tutorial we will see how we can resize images using Pillow and we will also talk about a common pitfall while using it.

Time codes:
---------------
00:00: Introduction
00:33: Introduction to Pillow
01:04: Resizing the image
06:51: Caution with Aspect ratio
08:00: Conclusion

Links:
-------

Other image manipulation libraries in Python:
- OpenCV
- Scikit-image

Social Media:
-----------------

Video Summary:
---------------------
Using Pillow, we can resize images in Python. Pillow can be installed from the PyPi server using "pip install pillow".
Resize function only takes a tuple of width and height. Without that we will get a ValueError.
Resize function also doesn't have any safeguards against aspect ratio changes. So, we need to make sure that the width and height passed in maintain the
Original proportions of the image. Otherwise it will either get skewed and squished or stretched.

Attributions:
---------------
Thumbnail Mt. Fuji - Photo by Tirachard Kumtanom from Pexels
Keyboard sounds - CC Attribution 3.0 License - By Anton from from freesound
Background Music - A New Orleans Crawfish Boil - Unicorn Heads - Youtube Audio
Lucky Cat - Video by Miguel Á. Padriñán from Pexels
Mt. Fuji - Free for commercial use - Image by K. Mishina from Pixabay

Tools/Gear:
---------
Operating System - Windows 10
Python IDE - Pycharm
Video Editor - Shotcut
Audio Editor - Audacity
Thumbnail Editor - Canva
Рекомендации по теме
Комментарии
Автор

most easy to understand tutorial i have seen

vishalrajput
Автор

Hi Swaroop,
A very good explanation
I have a problem.
can you please help me?
I want resize multiple images.
How to do that
I have a small script and if you like i can send it for you, so you can check

autarroy
Автор

Mt Fuji is generally referred to as Fuji-san or Fuji-sama. Kun is used by kids in the same manner adults would use "San".

cyberhard
Автор

bro there is some sort of attribut error..- 'tuple' object has no attribute 'resize'

vishaldevasi
Автор

lol this guy is hilarious. Funny acting.

lawregulator
Автор

Bro, that intro was CRINGE AF. Nice attempt but ffs

EIsenah