This API watermark from Tencent Cloud CI is used to provide image watermarking in COS. Currently, watermark images must be those stored in buckets associated with CI. Supported original images must be smaller than 20 MB in size and smaller than 9,999 pixels in length and width.
Image processing is a paid service, the fees of which are charged by Cloud Infinite. For detailed billing instructions, see Cloud Infinite’s [Billing and Pricing] (https://intl.cloud.tencent.com/document/product/1045/33431).
download_url?watermark/1/image/<encodedURL> /gravity/<gravity> /dx/<dx> /dy/<dy> /blogo/<type>
Please ignore the preceding spaces and line breaks.
Operation name: watermark. 1 indicates that the watermark is an image watermark.
|download_url||URL that is used to access a file. Format:
|/image/||The URL of the watermark image, which must be URL-safe Base64 encoded. For example, the watermark image is
|/gravity/||Text watermark position, which is shown in a 3 x 3 grid (See the 3 x 3 positioning grid). The default value is SouthEast.|
|/dx/||Horizontal margin in pixels. The default value is 0.|
|/dy/||Vertical margin in pixels. The default value is 0.|
|/blogo/||The watermark image adaptation feature, which is applicable to scenarios in which the watermark image size is too large, for example, a watermark wall. There are two options:
A specified watermark image must meet the following conditions:
examplebucket-1250000000.image.myqcloud.comis a CDN acceleration domain name, and therefore cannot be used as a watermark URL.
http://. The HTTP header cannot be omitted or replaced by an HTTPS header. For example,
https://examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/shuiyin_2.pngare invalid watermark URLs.
A 3 x 3 positioning grid provides position reference for multiple image operations. Red dots show the origin points of each region. After you use the gravity parameter to select a region, displacement must be based on the corresponding farthest point.
gravityis set to center, the
dyparameters are invalid.
gravityis set to north or south, the
dxparameter is invalid (in which case the watermark is horizontally centered).
gravityis set to west or east, the
dyparameter is invalid (in which case the watermark is vertically centered).
This example shows you how to add an image watermark.