← Back to Skills Marketplace
cribug

Universal Watermarker

by cribug · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ✓ Security Clean
134
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install universal-watermarker
Description
Adds customizable text watermarks with adjustable opacity and layout to PDFs and images, saving results with wm_ prefix in the original folder.
README (SKILL.md)

Universal Watermarker Skill

一款具有高度工程化水准的文件防伪处理工具。支持 PDF 与图片混批,内置响应式排版引擎,字体自动映射与文件全内置,彻底解决乱码、水印移位与缩放兼容性问题。

核心模式 (Modes)

  1. diagonal (对角单水印 - 默认):水印从画面左下角贯穿至右上角。极客级三角函数计算,无论文档是横是竖,均能保证完美端对端覆盖。
  2. center (居中单水印):水平放置于文档核心视角的正中央。
  3. tile (全图平铺):满屏交叉斜向覆盖,极致防伪。

运行环境

  • Language: Python 3.8+
  • Dependencies: pypdf, reportlab, Pillow
  • OS Support: Windows, macOS, Linux (无系统级底层 GUI 依赖)

参数定义 (Parameters)

参数名 类型 必填 默认值 描述
files list/string 待处理的文件路径(支持单个路径字符串或路径列表)。
text string 水印文字内容(如 "内部机密")。
opacity float 0.3 水印不透明度,范围 0.0 到 1.0。
scale float None (智能默认) 响应式字体比例 (0.0~1.0)。\x3Cbr>diagonal 默认 0.8(占据对角线 80%)\x3Cbr>center 默认 0.5(占据画面宽度 50%)\x3Cbr>tile 默认 0.25
mode string "diagonal" 渲染模式:"diagonal", "center", "tile"
angle int 30 水印倾斜角度(仅在 mode="tile" 时生效)。
auto_adjust bool True 自动背景亮度感应,在 colorNone 时智能切换深色/浅色水印。
color string/tuple None 自定义水印颜色,可传入十六进制 "#FF0000" 或 RGB 元组 (255,0,0)。若设置,将无视自动亮度调节。
font_path string "./fonts/AlibabaPuHuiTi-3-65-Medium.ttf" 字体文件路径,支持 .ttf 和 .ttc。

输入与输出规范 (I/O)

  • 存储位置: 处理后的文件直接保存在原文件所在目录下。
  • 命名约定: 输出文件名为 wm_ 前缀加上原文件名。

AI 调用指令参考 (Instructions for LLM)

  1. 语义推断:如果用户要求“防伪”、“机密保护”、“铺满”,请自动设置 mode="tile"。如果用户要求“淡一点”,请将 opacity 调低至 0.1-0.2。
  2. 确认闭环:执行 process_files 完毕后,必须向用户明确播报输出文件的确切路径和名称,不要让用户自己去寻找。
Usage Guidance
This skill appears to do what it claims (watermark images/PDFs). Before installing: 1) Review the complete main.py (the provided excerpt is truncated) to confirm there are no additional network endpoints or unexpected behavior. 2) Note it will download a font at first run from https://raw.githubusercontent.com — verify that URL and the font license are acceptable for you. 3) Install dependencies (pypdf, reportlab, Pillow) in an isolated virtualenv or sandbox and run tests on non-sensitive files first. 4) Confirm output naming/paths (wm_ prefix, saved next to originals) are acceptable and that no unrelated files are modified. If you cannot review the full source, run it in a restricted environment or decline installation.
Capability Analysis
Type: OpenClaw Skill Name: universal-watermarker Version: 2.0.0 The skill is a legitimate utility for watermarking PDF and image files using standard libraries like Pillow, pypdf, and reportlab. The code in main.py implements responsive watermarking logic (diagonal, center, and tile modes) and includes a setup function to download a necessary font file from the author's GitHub repository (raw.githubusercontent.com/cribug/universal-watermarker). The instructions in SKILL.md are well-aligned with the tool's purpose, providing helpful guidance for the AI agent without any signs of prompt injection or malicious intent.
Capability Assessment
Purpose & Capability
Name, description, SKILL.md, requirements.txt, and main.py all align: the code implements text watermarks for images and PDFs and saves outputs with a prefix in the original folder.
Instruction Scope
SKILL.md keeps scope to watermarking behavior (modes, parameters, and confirming output paths). It does not instruct reading unrelated system files or requiring unrelated credentials.
Install Mechanism
There is no install spec (instruction-only from registry), but main.py will at runtime fetch a font from raw.githubusercontent.com into ./fonts. Using raw.githubusercontent.com is a common, generally acceptable pattern for static assets, but it is an external network fetch and should be noted.
Credentials
The skill requests no environment variables or credentials. The code shown does not access secrets or unrelated system config; its write access is limited to creating a ./fonts folder and writing output files next to inputs.
Persistence & Privilege
Skill is not always-enabled, does not request persistent system-wide privileges, and does not modify other skills' configs. Its file writes are confined to fonts/ and the original file directories.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install universal-watermarker
  3. After installation, invoke the skill by name or use /universal-watermarker
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.0.0
Universal Watermarker 2.0.0 is a major upgrade with expanded features and more precise customization: - 新增 `diagonal` 模式,默认采用左下至右上的对角水印,自动完美覆盖各类文档。 - 支持 `scale` 参数,实现水印自动响应式缩放。 - 增加 `color` 参数,可自定义水印颜色,或启用智能亮度水印切换(`auto_adjust`)。 - 支持自定义字体文件路径(`font_path`),实现全内嵌兼容,杜绝乱码与移位。 - 详细完善模式说明,支持 PDF 与主流图片混批操作。
v1.1.0
- Added new parameter: `auto_adjust` (bool, default: True) — automatically switches watermark color (black/white) based on background brightness. - Existing features and parameter behaviors remain unchanged.
v1.0.0
Universal Watermarker v1.0.0 – Initial Release - Add customizable text watermarks to PDF, JPG, PNG, and BMP files. - Supports both single-center and anti-counterfeit tiling watermark modes. - Adjustable font size, opacity, angle (for tiling), and smart cross-platform Chinese font recognition. - Watermarked files are output with a wm_ prefix in the source file’s directory. - Fully cross-platform; no system-level GUI dependencies required.
Metadata
Slug universal-watermarker
Version 2.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Universal Watermarker?

Adds customizable text watermarks with adjustable opacity and layout to PDFs and images, saving results with wm_ prefix in the original folder. It is an AI Agent Skill for Claude Code / OpenClaw, with 134 downloads so far.

How do I install Universal Watermarker?

Run "/install universal-watermarker" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Universal Watermarker free?

Yes, Universal Watermarker is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Universal Watermarker support?

Universal Watermarker is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Universal Watermarker?

It is built and maintained by cribug (@cribug); the current version is v2.0.0.

💬 Comments