Image Resizing Script in Python


from PIL import Image #pip install Pillow

def resize_your_image(width, height):

      image_address = "new-img.jpg"
      image = Image.open(image_address)
      print("The original size of your image is",image.size)

      image_resize = image.resize((width, height))
      print("Image successfully resized to",image_resize.size)
      image_resize.save(f"r-img-{image_resize.size}.jpg")
      print("Image successfully saved.")

print("Welcome to Image Resizer!")

width=int(input("Plz enter the required width: "))
height=int(input("Plz enter the required height: "))

resize_your_image(width, height)
Python

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

Making GUI Calculator in Tkinter Python

Unlocking Web Design: A Guide to Mastering CSS Layout Modes