Text watermarks

更新时间:
复制 MD 格式

A text watermark adds text to an image.

Access type

@watermark=2&text=<encodeText>&type=<encodeType>&size=<size>&color=<encode colr>&t=<t>&p=<p>&x=<x>&voffset=<offset>&y=<y>

The watermark and object parameters are required.

Note

The term `url_safe_base64_encode` in this document refers to URL-safe Base64 encoding. For more information, see Keywords.

Parameters

Name

Description

Value

Type

text

The text content of the watermark. This value must be encoded.

Note

The value must be URL-safe Base64 encoded. encodeText = url_safe_base64_encode(fontText). The maximum length is 64 characters, which supports about 20 Chinese characters.

Required

type

The font of the watermark text. This value must be encoded.

Note

The value must be URL-safe Base64 encoded. encodeText = url_safe_base64_encode(fontType)

Valid values: See the Font type encoding table.

Default value: `wqy-zenhei`. The encoded value is `d3F5LXplbmhlaQ`.

Optional

color

The color of the watermark text. This value must be encoded.

Note

The value must be URL-safe Base64 encoded. EncodeFontColor = url_safe_base64_encode(fontColor). The value must be a six-digit hexadecimal number prefixed with a number sign (#). For example, `#000000` represents black and `#FFFFFF` represents white. The six digits represent the RGB color value.

Default value: `#000000` (black). The Base64-encoded value is `IzAwMDAwMA`.

Optional parameters

size

The font size of the watermark text in pixels (px).

Valid values: (0, 1000].

Default value: 40.

Optional

s

The transparency of the watermark text shadow.

Valid values: (0, 100].

Optional parameters

For information about watermark position parameters, see Basic parameters.

Font type encoding table

Parameter value

Meaning in Chinese

URL-safe Base64 encoded value

Notes

wqy-zenhei

WenQuanYi Zen Hei

d3F5LXplbmhlaQ==

The padding character (=) can be omitted based on RFC specifications. The value then becomes `d3F5LXplbmhlaQ`.

wqy-microhei

WenQuanYi Micro Hei

d3F5LW1pY3JvaGVp

None

fangzhengshusong

FangZheng ShuSong

ZmFuZ3poZW5nc2h1c29uZw==

The padding character (=) can be omitted based on RFC specifications. The value then becomes `ZmFuZ3poZW5nc2h1c29uZw`.

fangzhengkaiti

FangZheng KaiTi

ZmFuZ3poZW5na2FpdGk=

The padding character (=) can be omitted based on RFC specifications. The value then becomes `ZmFuZ3poZW5na2FpdGk`.

fangzhengheiti

FangZheng HeiTi

ZmFuZ3poZW5naGVpdGk=

The padding character (=) can be omitted based on RFC specifications. The value then becomes `ZmFuZ3poZW5naGVpdGk`.

fangzhengfangsong

FangZheng FangSong

ZmFuZ3poZW5nZmFuZ3Nvbmc=

The padding character (=) can be omitted based on RFC specifications. The value then becomes `ZmFuZ3poZW5nZmFuZ3Nvbmc`.

droidsansfallback

DroidSansFallback

ZHJvaWRzYW5zZmFsbGJhY2s=

The padding character (=) can be omitted based on RFC specifications. The value then becomes `ZHJvaWRzYW5zZmFsbGJhY2s`.

Examples