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)
   

    

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes