This API is used to provide real-time text watermarking in Tencent Cloud CI. Currently, images smaller than 20 MB in size and smaller than 9,999 pixels in length and width are supported.
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. The URL form is
|/text/||Watermark content, which is encoded with Base64 that is safe to the URL.|
|/font/||Watermark font, which is encoded with Base64 that is safe to the URL. The default value is tahoma.ttf.|
|/fontsize/||Watermark text fontsize in pounds. The default value is 13.|
|/fill/||Watermark font color, which must be set to the hexadecimal RGB format (such as #FF0000). The default value is gray. For more information, see RGB Code Table. The value must be encoded with Base64 that is safe to the URL. The default value is #3D3D3D.|
|/dissolve/||Text transparency. Value range: 1 - 100. The default value is 90, which indicates total non-transparency.|
|/gravity/||Text watermark position, which is a 3x3 grid position (See the 3x3 grid position diagram). 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 3x3 grid position diagram 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 origin point.
This example shows you how to add a text watermark.
After the text watermark is added, the effect is as follows: