This API watermark from Tencent Cloud CI is used to provide real-time text watermarking in COS. Currently, supported images are 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.
download_url?watermark/2/text/<encodedText> /font/<encodedFont> /fontsize/<fontSize> /fill/<encodedColor> /dissolve/<dissolve> /gravity/<gravity> /dx/<dx> /dy/<dy> /batch/<type> /degree/<degree>
Please ignore the preceding spaces and line breaks.
Operation name: watermark. The number 2 indicates the watermark type is text watermark.
|download_url||URL that is used to access a file. Format:
|/text/||Watermark content, which must be URL Safe Base64 encoded|
|/font/||Watermark font, which must be URL Safe Base64 encoded. Default: tahoma.ttf.|
|/fontsize/||Watermark text font size in pounds. The default value is 13.|
|/fill/||Watermark font color, which must be set to the hexadecimal RGB format (such as #FF0000), and URL Safe Base64 encoded. The default value is gray #3D3D3D. For more information, see RGB Color Codes Chart.|
|/dissolve/||Text transparency. Value range: 1 - 100. The default value is 90, which indicates total non-transparency.|
|/gravity/||Text watermark position, which is shown in a 3 x 3 grid (See 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.|
|/batch/||Tiled watermarking, which can tile the text watermark to the entire image. If you set batch to 1, tiled watermarking is enabled.|
|/degree/||Rotation angle of the text watermark. Value range: 0 - 360. The default value is 0.|
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 take place 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 centered horizontally).
gravityis set to west or east, the
dyparameter is invalid (in which case the watermark is centered vertically).
This example shows you how to add text watermark.