Python | Resize Image with Pillow
HTML-код
- Опубликовано: 13 мар 2019
- You can easily resize your original image to a new set of dimensions with the Pillow library. In this video, we'll discuss some of the best practices of resizing while maintaining aspect ratio.
Great short video!
thanks! this really helped!
Thanks!! This helped :)
Will thi is work for graph...
It seems that when I type
im = Image.open("advancedinteractivedevelopmentlogo.jpg")
it can't find the file. Do I need to type the file path?
Error code:
FileNotFoundError: [Errno 2] No such file or directory: 'advancedinteractivedevelopmentlogo.jpg'
I use the PyCharm IDE
Thanks
Your image won't be in the folder where the program file is saved . Before the name of the image define it's path.
You can import os
And then use:
os.chdir(r'your path here')
oh yeah i had this problem for a while. now i just do
ROOT = __file__.strip('filename.py')
in every program lol
so when i need the image i can to
im = Image.open(f"{ROOT}image.png")