A small GUI tool to add repeating diagonal text watermarks to images. The left panel contains scrollable controls, and the right panel shows a live preview (auto-scaled to keep the whole image visible). Supports bilingual UI, Windows system fonts, and custom font-file override.
- Repeating diagonal watermark with adjustable:
- angle, spacing, row stagger shift, minimum repeats per row
- Style controls:
- text color, opacity, font size ratio, stroke width
- Font support:
- Windows system font dropdown (searchable)
- Override with
.ttf / .ttc / .otffont files (highest priority)
- Export formats: PNG / JPEG / BMP / WEBP
- Preview: debounced refresh (~180ms), auto fit-to-view scaling
├─ app.py
├─ watermark_core.py
├─ requirements.txt
└─ assets/
└─ UI.png
- Windows 10/11 (system font listing relies on Windows Registry; on non-Windows it may fall back to default fonts)
- Python 3.10+ (recommended 3.11)
- Dependencies in
requirements.txt:pillow,pyside6,pyinstaller
conda create -n diagonal-watermark python=3.11 -y
conda activate diagonal-watermark
pip install -r requirements.txt
python app.pyWindows (PowerShell / CMD):
py -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
python app.py
If PowerShell blocks activation, adjust execution policy (e.g.,
Set-ExecutionPolicy RemoteSigned) or use CMD.
- Start the app:
python app.py - Click “Open/Replace Image…” and pick an image
- Adjust parameters on the left (preview updates automatically):
- Language: switch UI language (if the watermark text is still the default, it will switch with the language)
- System font: select or type to search
- Override font file: choose a font file to override; “Clear override” returns to system font
- Text color / Opacity: opacity range is 0–255
- Angle / Font size ratio
- Horizontal/Vertical spacing: larger values → sparser watermarks
- Row stagger shift: offsets every other row to avoid perfect alignment
- Min repeats/row: keeps at least N repeats per row by limiting spacing
- Stroke width: improves readability (0 disables stroke)
- Click “Export…” and choose output path/format
pyinstaller is included in requirements.txt.
pyinstaller -F -w app.py
-F: one-file executable-w: windowed mode (no console)
If you want to ship a custom font with the app, place it in your repo and use the “Override font file” button at runtime.
- Why is the system font list empty on non-Windows? This project enumerates Windows fonts via Registry. On other OSes it returns an empty list and uses fallback fonts.
- Why does JPEG export look different? JPEG doesn’t support alpha; the image is converted to RGB on export.
