Updated on 2024-08-09 GMT+08:00

Public Parameters

You can use the GUI or code mode on OBS Console or make an API call to configure public parameters for watermarking.

You can add a text or image watermark to the original image.

The Base64 code for URL transmission applies to paths of content and fonts of text watermarks, or paths of image watermarks. It is not advisable to put standard Base64 code directly into the URL for transmission. In Base64 encoding for URL transmission, contents are coded into character strings by standard Base64 code. After verifying these strings, replace the plus sign (+) with hyphen (-), and slash (/) with underline (_). For details about encoding, see those specified in RFC4648.

This operation is represented by watermark.

Public parameters are those applicable to both image watermarks and text watermarks. You can add these two types of watermarks to the same image. Table 1 describes the parameters.

Table 1 Public parameters

Parameter

Value Description

Code Example

g

Optional. g represents the watermark location. It can be set to tl, top, tr, left, center, right, bl, bottom, or br. The default value is tl.

Figure 1 shows a 3x3 grid illustrating these values. Each value locates at the top left corner of the cell.

image/watermark,image_aW1hZ2UtZGVtby

9sb2dvLnBuZw==,g_br,t_90,x_10,y_10

x

Optional. x represents the horizontal distance from the image edge. By default, the origin is at the top left corner. The value ranges from 0 to 4096, in pixels. The default value is 10.

y

Optional. y represents the vertical distance from the image edge. By default, the origin is at the top left corner. The value ranges from 0 to 4096, in pixels. The default value is 10.

voffset

Optional. voffset represents the vertical offset from the horizontal centerline of the image. It moves a watermark upward or downward from the horizontal centerline of the image. The value ranges from -1000 to 1000, in pixels. The default value is 0.

voffset is meaningful only when g is set to left, center, or right.

align

Optional. It represents the alignment of a watermark. The value can be 0 (default value), 1, or 2.

  • 0: top alignment
  • 1: center alignment
  • 2: bottom alignment

order

Optional. It represents the placement order of the text and image watermarks. The value can be 0 (default value) or 1.

  • 0: image watermark in front of the text watermark
  • 1: text watermark in front of the image watermark

t

Optional. It represents the transparency of a watermark. Its value ranges from 0 to 100. The default value is 100, indicating the watermark is not transparent at all.

interval

Optional. It represents the distance between a text watermark and an image watermark. Its value ranges from 0 to 1000.

Figure 1 shows a 3x3 grid illustrating the watermark locations.

Figure 1 3x3 grid of watermark locations

If both a text watermark and an image watermark are added to the same image, you can configure x, y, and voffset to adjust the watermark locations and their layout.