Posts

Showing posts with the label pillow module

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)