Batch Image Resizer Tool (Python/Pillow)
This is a command-line utility built in Python to automate the batch resizing of images within a specified folder. It uses the highly optimized Pillow (PIL) library for robust image processing.
This tool is designed to save time by processing multiple file types (JPG, PNG, GIF, BMP) while preserving image quality.
π οΈ Requirements
This script requires the Pillow library. You can install it using pip:
pip install Pillow
- Save the Script: Save the code as
image_resizer.py
. - Create Input Folder: In the same directory, create a folder named
input_images
. - Place Images: Put all the images you want to resize into the
input_images
folder.
Run the script from your terminal:
python image_resizer.py
A new folder named output_images
will be automatically created. This folder will contain all the resized files, named with the prefix resized_
to distinguish them from the originals.
image-resizer-tool/
βββ image_resizer.py # The core resizing script
βββ README.md # Project documentation
βββ input_images/ # Folder where you place original images
βββ photo1.jpg
βββ logo.png