Install in seconds
Install this skill
Copy the command and run it in your terminal. You can review the source before installing.
terminal
git clone https://github.com/CoderWanFeng/python-office

Works with Git. The repository opens in your current directory.

🖼️
AutomationPython

Add Watermark

by CoderWanFeng

Add text watermarks to images with customizable color, size, opacity, spacing, and angle using Python.

1.3K stars297 forksAdded 2026/07/20
officepippypipythonweixin

Documentation

README

add_watermark Skill

给图片加水印

功能描述

向图片添加文字水印,支持自定义颜色、大小、透明度、间距、角度等参数。

所属分类

office/skills/image/add_watermark/

调用方式

from office.skills.image import add_watermark

add_watermark(
    file='./test.png',
    mark='python-office',
    output_path='./',
    color="#eaeaea",
    size=30,
    opacity=0.35,
    space=200,
    angle=30
)

参数说明

参数 类型 必填 默认值 说明
file str - 图片位置
mark str - 水印内容
output_path str './' 输出位置
color str "#eaeaea" 水印颜色
size int 30 水印大小
opacity float 0.35 不透明度,范围 0.01~1
space int 200 水印间距
angle int 30 水印角度

返回值

None

使用示例

from office.skills.image import add_watermark
add_watermark(file='./photo.jpg', mark='我的水印')

原始函数

office.api.image.add_watermark