Python 3 Pillow Library Script to Convert Image to Youtube Video Thumbnail Size Full Project For Beginners

Python 3 Pillow Library Script to Convert Image to Youtube Video Thumbnail Size Full Project For Beginners

 

Welcome folks today in this post we will be converting image to youtube video thumbnail size for videos in python using the pillow library. All the full source code of the application is given below.

 

 

Get Started

 

 

In order to get started you need to install the following library as shown below using pip command

 

pip install pillow

 

After installing this library you need to make an app.py file and copy paste the following code

 

app.py

 

 

# importing Image class from PIL package  
from PIL import Image 
   
# creating a object  
image = Image.open(r"ankit bansal.png") 
MAX_SIZE = (1280,720) 
  
image.thumbnail(MAX_SIZE) 
  
# creating thumbnail 
image.save('pythonthumb.png') 
image.show()

 

 

Here we are taking the input image and converting to youtube thumbnail image which is of the size of 1280x720

 

READ  Python 3 Pillow Script to Bulk Compress or Minify Multiple PNG or JPEG Images in Current or Specific Directory Full Project For Beginners

And now if you execute the above script by typing the below command

 

python app.py

 

Leave a Reply