Quantcast
Viewing all articles
Browse latest Browse all 14040

how to create thumbnail of size 480 X 640 using python pillow?

I am new to python. I tried with this bellow code but it is not creating with my thumbnail size.

# Open the original image of size 1500X1500 original_image = Image.open("TM16224-1.jpg")# Create a thumbnail with a maximum size of 480x640 while preserving the aspect ratiooriginal_image.thumbnail((480, 640))# Save the thumbnailoriginal_image.save("thumbnail_image.png")# Optionally, you can also display the thumbnailoriginal_image.show()please help. 

Viewing all articles
Browse latest Browse all 14040

Trending Articles