Resize Image to Custom Size with just 4 Lines of Code!
Hey i know u have been using some online sites to resize an image but u need not use that anymore make one code that fulfills the need.
The above is the complete execution of code with understanding the implementation .
from PIL import Image
# Open the image
image = Image.open("input.jpg")
# Resize the image
resized_image = image.resize((2500,1500)) ?# (width, height)
# Save the cropped and resized image
resized_image.save("imgCroppingAndResizing/resized_image3.jpg")
Understanding the need is important , we can make our code for sure!
If you find this article intresting do follow and comment your suggestions / feedback.