Thumbnail Generator
Thumbnail Generator
This is a simple Python script that create thumbnails for all images in a directory. It uses the Python Imaging Library (PIL).
This script support batch processing, it keeps the original file name and directory structure.
Installation
You need to have Python 3 installed in your system.
Create a virtual environment
python -m venv .venv
source .venv/bin/activateInstall required libraries
pip install -r requirements.txtUsage
This script will overwrite the output files if they already exist.
For creating a single thumbnail, you can run the script with the following command:
python ./thumbnail_generator.py -i ./input_path/file.png -o ./output_path/ -q 30 -s 1000For batch processing, you can run the script with the following command:
python ./thumbnail_generator.py -i ./input_path/ -o ./output_path/ -q 30 -s 1000Arguments
-ior--input: Path to the input file or directory.-oor--output: Path to the output directory.--log-level(optional): Log level for the script. Default isWARNING. Possible values areDEBUG,INFO,WARNING,ERROR,CRITICAL.-por--process(optional): Number of process to use. Default is auto.-qor--quality(optional): Quality of the output image. Default is 30.-sor--size(optional): Size of the output image. Default is 1000.
Last updated on