This project is a Python script that recursively processes all images in the input
folder, adds a watermark to the bottom-center of each image, and saves the watermarked images in the output
folder while maintaining the original directory structure.
- Python 3.10 or higher
- Pillow library
-
Clone the repository:
git clone [email protected]:computerclubkec/watermarker.git cd watermark
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
- Place the images you want to process in the input folder.
- Place or replace your watermark image (must be PNG with transparency) in the project root directory and name it watermark.png.
- Run the script:
python apply_watermark.py
The script will process all images in the input folder and its subfolders, add the watermark to the bottom-center of each image, and save the watermarked images in the output folder, preserving the original directory structure.
You can configure the watermark size and padding by modifying the following variables in the apply_watermark.py script:
- scale_factor: Size of the watermark relative to the main image (default:
0.18
) - padding: Padding from the bottom-center in pixels (default:
300
)
python apply_watermark.py