A Thumbnail Generator that makes thumbnails from an entire folder.
- Python 95.4%
- Makefile 4.6%
|
|
||
|---|---|---|
| .gitattributes | ||
| .gitignore | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| requirements.txt | ||
| thumbgen.py | ||
Thumbgen
License
Required
Project Template
- README (this file)
- PIL License
What does it do?
This software is designed to convert all images in a directory to a specific size while keeping the main focus of said images. Supporting many image file types including AVIF and JXL.
How to use it?
- clone the repo
- cd into the folder
- run either of the following to build the application:
make depends
make build
or:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pyinstaller --onefile thumbgen.py
deactivate
- if you need to rebuild you will need to delete a few files:
rm -rf build dist thumbgen.spec
or:
make clean
- the following help can be accessed by executing:
./dist/thumbgen -h
or see the following:
usage: thumbgen [-h] -i INPUT_DIR -o OUTPUT_DIR -W WIDTH -H HEIGHT [-s SHARPEN_FACTOR]
Autocrop, resize to exact dimensions, and sharpen images in a directory.
options:
-h, --help show this help message and exit
-i, --input_dir INPUT_DIR
Input directory containing images.
-o, --output_dir OUTPUT_DIR
Output directory to save processed images.
-W, --width WIDTH Target width for resized images.
-H, --height HEIGHT Target height for resized images.
-s, --sharpen_factor SHARPEN_FACTOR
Sharpening factor (1.0 for original, higher for more sharpen). Default is 2.0
Examples
This creates images that are shrunk and cropped to the size of 150x150 while making the images sharper.
./dist/thumbgen -i input_images -o output_images -W 150 -H 150 -s 3.0