← 返回 Skills 市场
245
总下载
0
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install watermark-pro
功能描述
文件水印工具。Use when user wants to add watermark to images, Word, PowerPoint, or PDF files. Supports text watermark, logo watermark, diagonal/center/tile layouts....
使用说明 (SKILL.md)
Watermark Pro
文件水印工具,支持图片、Word、PPT、PDF添加水印。
Features
- 🖼️ 图片水印:支持JPG/PNG/WEBP
- 📄 Word水印:支持.docx
- 📊 PPT水印:支持.pptx
- 📑 PDF水印:支持.pdf
- ✍️ 文字水印:自定义文字、字体、颜色
- 🖼️ Logo水印:支持透明PNG Logo
- 📍 多种布局:对角线/居中/平铺
Trigger Conditions
- "加水印" / "Add watermark"
- "图片加水印" / "Word文档加水印"
- "watermark-pro"
Step 1: Image Watermark
from PIL import Image, ImageDraw, ImageFont
import os
class ImageWatermark:
def add_text_watermark(self, image_path, text, output_path,
font_size=None, color=(128, 128, 128),
opacity=0.3, angle=-45, layout='diagonal', density=200):
img = Image.open(image_path).convert('RGBA')
width, height = img.size
watermark = Image.new('RGBA', img.size, (0, 0, 0, 0))
draw = ImageDraw.Draw(watermark)
if font_size is None:
font_size = max(width, height) // 30
try:
font = ImageFont.truetype('/System/Library/Fonts/PingFang.ttc', font_size)
except:
font = ImageFont.load_default()
alpha = int(255 * opacity)
fill_color = (*color, alpha)
if layout == 'diagonal':
for y in range(0, height, density):
for x in range(0, width, int(density * 1.4)):
draw.text((x, y), text, font=font, fill=fill_color)
elif layout == 'center':
bbox = draw.textbbox((0, 0), text, font=font)
tw = bbox[2] - bbox[0]
th = bbox[3] - bbox[1]
draw.text(((width-tw)//2, (height-th)//2), text, font=font, fill=fill_color)
watermark = watermark.rotate(angle, expand=False, resample=Image.BICUBIC)
result = Image.alpha_composite(img, watermark)
if output_path.lower().endswith('.jpg'):
result = result.convert('RGB')
result.save(output_path)
return output_path
Step 2: Word Watermark
from docx import Document
from docx.shared import Pt, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
class WordWatermark:
def add_text_watermark(self, docx_path, text, output_path,
font_size=48, color=(200, 200, 200)):
doc = Document(docx_path)
for section in doc.sections:
header = section.header
header.is_linked_to_previous = False
for para in header.paragraphs:
para.clear()
para = header.paragraphs[0] if header.paragraphs else header.add_paragraph()
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = para.add_run(text)
run.font.size = Pt(font_size)
run.font.color.rgb = RGBColor(*color)
run.font.name = '宋体'
para.paragraph_format.space_before = Pt(250)
doc.save(output_path)
return output_path
Step 3: PowerPoint Watermark
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN
class PptWatermark:
def add_text_watermark(self, pptx_path, text, output_path,
font_size=60, color=(200, 200, 200)):
prs = Presentation(pptx_path)
for slide in prs.slides:
txBox = slide.shapes.add_textbox(Inches(1.5), Inches(3), Inches(7), Inches(1.5))
tf = txBox.text_frame
p = tf.paragraphs[0]
p.text = text
p.font.size = Pt(font_size)
p.font.color.rgb = RGBColor(*color)
p.alignment = PP_ALIGN.CENTER
prs.save(output_path)
return output_path
Step 4: PDF Watermark (Image Overlay)
import fitz
from PIL import Image, ImageDraw, ImageFont
import os
class PdfWatermark:
def add_text_watermark(self, pdf_path, text, output_path,
font_size=28, color=(128, 128, 128),
opacity=0.25, density=220):
doc = fitz.open(pdf_path)
for page in doc:
rect = page.rect
width, height = int(rect.width), int(rect.height)
wm_img = Image.new('RGBA', (width, height), (0, 0, 0, 0))
draw = ImageDraw.Draw(wm_img)
try:
font = ImageFont.truetype('/System/Library/Fonts/PingFang.ttc', font_size)
except:
font = ImageFont.load_default()
alpha = int(255 * opacity)
fill = (*color, alpha)
for y in range(0, height, density):
for x in range(0, width, int(density * 1.4)):
draw.text((x, y), text, font=font, fill=fill)
temp_img = os.path.join(os.path.dirname(output_path), '_temp_wm.png')
wm_img.save(temp_img)
page.insert_image(rect, filename=temp_img, overlay=True)
doc.save(output_path)
doc.close()
if os.path.exists(temp_img):
os.remove(temp_img)
return output_path
Usage Examples
User: "给图片加'版权所有'水印"
Agent: 使用 ImageWatermark.add_text_watermark()
User: "Word文档加'机密'水印"
Agent: 使用 WordWatermark.add_text_watermark()
User: "PDF加水印,密度高一点"
Agent: 使用 PdfWatermark.add_text_watermark(density=150)
Notes
- 纯本地处理,无隐私风险
- 支持中英文水印
- 跨平台兼容
安全使用建议
This skill is instruction-only and runs Python code locally to add watermarks. Before using: ensure you have python3 and are comfortable installing the listed Python packages (pip will download them from PyPI); only provide files you want processed; run in a sandbox if you have strict security requirements; review the pip package names yourself and, if desired, install dependencies in a virtual environment. There are no hidden network endpoints or credential requests in the SKILL.md, but installing dependencies does perform normal network downloads from PyPI.
功能分析
Type: OpenClaw Skill
Name: watermark-pro
Version: 1.0.4
The skill bundle provides legitimate functionality for adding text watermarks to images, Word, PowerPoint, and PDF files using standard libraries (Pillow, python-docx, python-pptx, and PyMuPDF). The code in SKILL.md performs local file processing without any network requests, unauthorized file access, or suspicious execution patterns.
能力评估
Purpose & Capability
Name/description (image/Word/PPT/PDF watermarking) match the provided Python code and declared dependency list (Pillow, python-docx, python-pptx, pymupdf). Requiring python3 is appropriate and proportional.
Instruction Scope
SKILL.md contains concrete Python implementations that operate on user-supplied files and write outputs locally. The instructions do not reference unrelated files, credentials, or external endpoints. They stay within the watermarking use case.
Install Mechanism
There is no formal install spec; SKILL.md lists a pip install line for common PyPI packages. That implies the agent (or user) will download packages from PyPI at runtime — expected for Python-based tooling but worth noting since it performs network downloads to install dependencies.
Credentials
No environment variables, credentials, or system config paths are requested. The code only reads/writes files supplied by the user and temporarily writes a local temp image for PDF processing — this is proportional to the documented functionality.
Persistence & Privilege
The skill is not always-enabled and does not request elevated or persistent system presence. It does not modify other skills or system-wide configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install watermark-pro - 安装完成后,直接呼叫该 Skill 的名称或使用
/watermark-pro触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
恢复完整代码示例,精简文字描述,确保功能完整
v1.0.3
精简SKILL.md:移除冗长代码示例,确保安全扫描完整
v1.0.2
改进PDF水印:使用图片叠加方式,效果更清晰,支持所有5种格式
v1.0.1
添加PDF水印支持:使用PyMuPDF,支持4种文档类型(图片/Word/PPT/PDF)
v1.0.0
文件水印工具:支持图片/Word/PPT添加文字或Logo水印,多种布局,纯本地处理
元数据
常见问题
Watermark Pro 是什么?
文件水印工具。Use when user wants to add watermark to images, Word, PowerPoint, or PDF files. Supports text watermark, logo watermark, diagonal/center/tile layouts.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 245 次。
如何安装 Watermark Pro?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install watermark-pro」即可一键安装,无需额外配置。
Watermark Pro 是免费的吗?
是的,Watermark Pro 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Watermark Pro 支持哪些平台?
Watermark Pro 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Watermark Pro?
由 ToBeWin(@tobewin)开发并维护,当前版本 v1.0.4。
推荐 Skills