Baidu AI Cloud
中国站

百度智能云

Object Storage

Add Photo Watermark

Overview

This article introduces how to add a photo watermark to a photo.

Watermark Parameters of Photos

Name of action: watermark

Watermark parameters of images Value Description
bucket - Designate the Bucket name of the watermark image stored in BOS, however, it is not required, and the default one is current bucket. It requires that the watermark image has public read permission for non-current bucket.
image - Designate the object name of the watermark image stored in BOS, and it needs to take the safe Base64 encoded value of url. Required parameters for image watermark.
t 1-100 Designate the transparency of the image watermark, and when the value is 100, it means that it is the same as the original transparency. It is not required, and the default value is 100.
g 1-9 Designate the anchor location for the watermark. It is not required, and the default is 9. See the following description for specific meaning.
x -4096-4096 Designate the horizontal distance of the watermark based on the anchor. It is not required, and the default value is 10.
y -4096-4096 Designate the vertical distance of the watermark based on the anchor. It is not required, and the default value is 10.
a -360-360 Designate the rotation angle of watermark. The positive number indicates clockwise rotation and the negative number indicates counterclockwise rotation. It is not required, and the default value is 0.

Note

  • Currently, it is not supported to specify both photo and text watermarks in a group of actions, and only one type of photo or text watermark can be specified. If you need to specify photo and text watermarks, you can use multiple groups of actions.
  • Anchor position description: divide your original photo into 9 areas as shown in the figure below, and number them according to the positions shown in the figure, where the anchor position of each area is as shown in the figure:

BOS8.png

Example

  • Add photo watermark

https://doc.bce.baidu.com/bce-documentation/BOS/image.jpg?x-bce-process=image/watermark,image_YmNlLWRvY3VtZW50YXRpb24vQk9TL2JjZS5qcGc=,g_9,a_90

Previous
Add Text Watermark
Next
Add Mixed Image and Text Watermark