./watermark.sh input.jpg "僅供 linnil1 使用" output.jpg /OTF/TraditionalChinese/NotoSansCJKtc-Regular.otf
#!/bin/sh
podman run -it --rm \
-v $4:/font/noto_sans_tc.otf:ro \
-v $PWD:/app -w /app \
docker.io/dpokidov/imagemagick \
\( $1 -strip -interlace Plane -gaussian-blur 0.1 -resize 1500x1500 -quality 90% \) \
\( -size 1500x1500 xc:none -pointsize 100 -fill "rgba(0,0,0,0.2)" -gravity center -font "/font/noto_sans_tc.otf" \
-draw "rotate -$((RANDOM % 60)) text 0,0 '$2'" \) \
-gravity center -composite $3
- Docker or Podman installed
- Download a Chinese font, e.g., NotoSansCJK TC
After:
I changed the color to rgba(255,255,255,0.2)
and removed -gaussian-blur 0.1
for better text quality: