A fast, parallelized image processing script for batch resizing and center-cropping images using Pillow and Python’s multiprocessing. Includes a simple CLI to choose tasks and auto-organizes output folders with timestamps.
small
, medium
, large
)data/original/
→ Input folder for original images to resizedata/resized/1x - TIMESTAMP/
→ Output of resized imagesdata/cropped/cropped - TIMESTAMP/
→ Output of cropped imagesSubfolders named
small
,medium
, orlarge
in the resized folder are used for cropping based on defined ratios.
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
pip install -r requirements.txt
python main.py
SCALE_FACTOR
to change resize scaleCROP_RATIOS
to define new crop sizesSKIP_FOLDERS
to exclude from processing.png, .jpg, .jpeg, .bmp, .tiff
Documentation last updated at: Sat 7 Jun 11:25 PM