A simple Python script to batch resize images in a folder to a specified width, maintaining aspect ratio.
- Resizes
.png
,.jpg
, and.jpeg
images - Maintains original aspect ratio
- Saves resized images to a specified output folder
- Command-line interface
- Python 3.x
- Pillow library
Install Pillow with:
pip install pillow
python resizer.py <input_folder> <output_folder> <width>
<input_folder>
: Path to the folder containing images to resize<output_folder>
: Path to the folder where resized images will be saved<width>
: Target width for resized images (height is calculated automatically)
python resizer.py images/ resized/ 800
- Resized images are saved in the output folder.
- The script prints a success or error message for each file.
MIT