Resize Image to Custom Size with just 4 Lines of Code!

Resize Image to Custom Size with just 4 Lines of Code!

#python #imageprocessing

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.

要查看或添加评论,请登录

Bhuvana Raju Gampa的更多文章

社区洞察

其他会员也浏览了