Guide to adding identifiers to AI-generated images
This document describes how to add data identifiers to images.
Background
According to the "Measures for Identifying AI-Generated and Synthesized Content", starting from September 1, 2025, all content generated by artificial intelligence (AI), such as images, audio, and videos, must include both visible and invisible identifiers. These identifiers can be metadata tags or digital watermarks. This ensures that the source of the content is traceable and identifiable.The Secure Access Service Edge (SASE) platform provides the CreateWmEmbedTask API. This API helps enterprises manage content identifiers efficiently and meet compliance requirements.
Image watermark parameter descriptions
Name | Type | Required | Description | Example | |
WmType | string | Yes | The watermark type. Valid values:
| PureImage | |
Filename | string | Yes | The name of the file to embed the watermark in. The backend uses the file extension to verify the file type. | abc****.pdf | |
FileUrl | string | Yes | The URL from which the file can be downloaded. The URL must be accessible over the public network. | https://example.com/abc****.pdf | |
WmInfoSize | long | No | The bit width of the watermark information. The default value is 32. This parameter must be the same for both embedding and fetching. For example, if you use a 40-bit software development kit (SDK) for embedding, you must also set this parameter to 40 for fetching. Enumeration values:
| 32 | |
WmInfoUint | string | No | The watermark information in decimal format. If you set this parameter, you cannot set WmInfoBytesB64. The value range depends on the WmInfoSize parameter:
| 123*** | |
WmInfoBytesB64 | string | No | The watermark information as a Base64-encoded string. If you set this parameter, you cannot set WmInfoUint. | aGVsbG8gc2F***** | |
ImageEmbedLevel | long | No | Image watermark parameter. A larger value provides higher robustness but reduces visual quality. The default value is 2. Valid values: 0 to 4. | 2 | |
ImageEmbedJpegQuality | long | No | Image watermark parameter. The desired JPEG compression quality factor for the output image. The default value is 95. Valid values: 1 to 100. | 95 | |
ImageControl | object | No | Image watermark control parameters. | ||
TextVisibleControl | object | No | Image text watermark control parameters. | ||
VisibleText | string | No | The text for the watermark. The format is a UTF-8 string. | Watermark text | |
Mode | string | No | The display mode for the text watermark. Valid values:
| pos | |
Opacity | integer | No | The opacity of the text watermark. Valid values: 1 to 255. A larger value means the watermark is more opaque. | 255 | |
FontSize | long | No | The font size of the text watermark. A larger value means a larger font. | 30 | |
FontColor | string | No | The color of the text watermark. The format is an RGB color value, such as 0xFFFFFF or #FFFFFF. For example, 0x000000 or #000000 represents black. | #FF0000 | |
Angle | long | No | The clockwise rotation angle of the text watermark in degrees. The value range is 0 to 360. | 30 | |
PosX | long | No | This parameter is active when Mode is set to pos. It controls the horizontal position of the text watermark in pixels, with the top-left corner as the origin. | 0 | |
PosY | long | No | This parameter is active when Mode is set to pos. It controls the vertical position of the text watermark in pixels, with the top-left corner as the origin. | 0 | |
SpaceX | long | No | This parameter is active when Mode is set to repeat. It controls the horizontal spacing of the tiled text watermark. | 30 | |
SpaceY | long | No | This parameter is active when Mode is set to repeat. It controls the vertical spacing of the tiled text watermark. | 0 | |
PosAx | float | No | The horizontal anchor point of the text watermark. The value range is 0 to 1. If (PosAx, PosAy) is (0, 0), the anchor is the top-left corner of the text. If the value is 0.5, the anchor is the center of the text. If the value is (1, 1), the anchor is the bottom-right corner of the text. | 0 | |
PosAy | float | No | The vertical anchor point of the text watermark. The value range is 0 to 1. If (PosAx, PosAy) is (0, 0), the anchor is the top-left corner of the text. If the value is 0.5, the anchor is the center of the text. If the value is (1, 1), the anchor is the bottom-right corner of the text. | 0 | |
Visible | boolean | No | Visibility: true: The item is displayed. false: The item is not displayed. | true | |
Margin | object | No | This parameter is active when Mode is set to top-left, top-right, bottom-left, or bottom-right. It specifies the margin. | ||
Top | float | No | This parameter is active when Mode is set to top-left or top-right. It specifies the top margin. | 0 | |
Right | float | No | This parameter is active when Mode is set to top-right or bottom-right. It specifies the right margin. | 0 | |
Bottom | float | No | This parameter is active when Mode is set to bottom-left or bottom-right. It specifies the bottom margin. | 0 | |
Left | float | No | This parameter is active when Mode is set to top-left or bottom-left. It specifies the left margin. | 0 | |
LogoVisibleControl | object | No | Logo watermark control parameters. | ||
LogoBase64 | string | No | The logo watermark in Base64 format. The logo file must be a PNG image converted to Base64 format. | iVBORw0KGgoAAAANSUhEUgAAAMgAAADICA************* | |
Mode | string | No | The display mode for the logo watermark. Valid values:
| pos | |
Opacity | integer | No | The opacity of the logo watermark. Valid values: 1 to 255. A larger value means the watermark is more opaque. | 255 | |
Angle | long | No | The clockwise rotation angle of the logo watermark in degrees. The value range is 1 to 360. | 30 | |
PosX | long | No | This parameter is active when Mode is set to pos. It controls the horizontal position of the visible watermark in pixels, with the top-left corner as the origin. | 0 | |
PosY | long | No | This parameter is active when Mode is set to pos. It controls the vertical position of the visible watermark in pixels, with the top-left corner as the origin. | 0 | |
SpaceX | long | No | This parameter is active when Mode is set to repeat. It controls the horizontal spacing of the tiled visible watermark. | 30 | |
SpaceY | long | No | This parameter is active when Mode is set to repeat. It controls the vertical spacing of the tiled visible watermark. | 30 | |
PosAx | float | No | The horizontal anchor point of the logo watermark. The value range is 0 to 1. If (PosAx, PosAy) is (0, 0), the anchor is the top-left corner of the text. If the value is 0.5, the anchor is the center of the text. If the value is (1, 1), the anchor is the bottom-right corner of the text. | 0 | |
PosAy | float | No | The vertical anchor point of the logo watermark. The value range is 0 to 1. If (PosAx, PosAy) is (0, 0), the anchor is the top-left corner of the text. If the value is 0.5, the anchor is the center of the text. If the value is (1, 1), the anchor is the bottom-right corner of the text. | 0 | |
Visible | boolean | No | Visibility: true: The item is displayed. false: Not displayed. | true | |
Margin | object | No | This parameter is active when Mode is set to top-left, top-right, bottom-left, or bottom-right. It specifies the margin. | ||
Top | float | No | This parameter is active when Mode is set to top-left or top-right. It specifies the top margin. | 0 | |
Right | float | No | This parameter is active when Mode is set to top-right or bottom-right. It specifies the right margin. | 0 | |
Bottom | float | No | This parameter is active when Mode is set to bottom-left or bottom-right. It specifies the bottom margin. | 0 | |
Left | float | No | This parameter is active when Mode is set to top-left or bottom-left. It specifies the left margin. | 0 | |
MetadataControl | object | No | Metadata control parameters. This parameter is active when WmType is set to PureImage or AigcImage. | ||
XmpKvBase64 | string | No | The metadata in Base64 format. | QUlHQzp7IkxhYmVsIjoiMSIsIkNvbnRlbnRQcm9kdWNlciI6IkFMSVlVTi1UT05HWUlRSUFOV0VOIiwiUHJvZHVjZUlEIjoiNzQ3MjAzNzQyMDczNDIiLCJQcm9wYWdhdG9yIjoiQUxJWVVOLVRPTkdZSVFJQU5XRU4iLCJQcm9wYXRvcklEIjoiNDU3MjM0NjciLCJSZXNlcnZlQ29kZSI6IjU2MDQ1NzM3In0= | |
Enable | boolean | No | Specifies whether to enable this feature. true: It is displayed. false: The item is not displayed. | true | |
Metadata format description
The XmpKvBase64 field requires metadata in Base64 format. Before you encode the metadata in Base64, it must meet the following format requirements.
KEY | Description | Example value |
Label | Indicates whether the content is generated by AI:
| 1 |
ContentProducer | The code or name of the service provider, used to identify the content producer.
For more information, see the Network Security Standard Practice Guide. | 001191******M000100Y43 |
ProduceID | The content production number. This is a unique identifier used by the production platform to trace synthesized content. | 123456 |
ReserveCode1 | Reserved field. This can store information for the generation and synthesis service provider to implement their own security protection and ensure content and identity integrity. A hashing mechanism based on ContentProducer and ProduceID can be used for secure storage and verification of key information. | d41d8cd98f00b204e9800998ecf8427e |
ContentPropagator | The name, number, or code of the distribution platform. For services that provide AI-generated and synthesized content, this can be the same as ContentProducer. | 001191******M000100Y43 |
PropatorID | The content distribution number. This is a unique number assigned by the distribution platform to the distributed generated and synthesized content. | 123456 |
ReserveCode2 | Reserved field. This can be used by the content distribution service provider to implement their own security protection and ensure content and identity integrity. A hashing mechanism based on ContentProducer and ProduceID can be used for secure storage and verification of key information. | d41d8cd98f00b204e9800998ecf8427e |
For example, consider a production platform company named AA with the Unified Social Credit Code 91******M000100Y43.
AIGC: {
"Label": "1",
"ContentProducer": "001191******M000100Y43",
"ProduceID": "123456",
"ReservedCode1": "d41d8cd98f00b204e9800998ecf8427e",
"ContentPropagator": "001191******M000100Y43",
"PropagateID": "123456",
"ReservedCode2": "d41d8cd98f00b204e9800998ecf8427e"
}Example
{
"ImageControl": {
"MetadataControl": {
"XmpKvBase64": "QUlHQzp7IkxhYmVsIjoiMSIsIkNvbnRlbnRQcm9kdWNlciI6IjAwMTE5MSoqKioqKk0wMDAxMDBZNDMiLCJQcm9kdWNlSUQiOiIxMjM0NTYiLCJSZXNlcnZlZENvZGUxIjoiZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2UiLCJDb250ZW50UHJvcGFnYXRvciI6IjAwMTE5MSoqKioqKk0wMDAxMDBZNDMiLCJQcm9wYWdhdGVJRCI6IjEyMzQ1NiIsIlJlc2VydmVkQ29kZTIiOiJkNDFkOGNkOThmMDBiMjA0ZTk4MDA5OThlY2Y4NDI3ZSJ9",
"Enable": true
},
"TextVisibleControl": {
"VisibleText": "AI Generated",
"Mode": "bottom-right",
"Opacity": 255,
"FontSize": 40,
"FontColor": "#FFFFFF",
"Visible": true,
"Margin": {
"Right": 20,
"Bottom": 20
}
}
},
"WmType": "PureImage",
"Filename": "IMG_1937.PNG",
"FileUrl": "https://fangtingtest.oss-cn-hangzhou.aliyuncs.com/IMG_1937.PNG?Expires=1757020815&OSSAccessKeyId=TMP.3Kpr************&Signature=hwGQSxItTDS1EeFPGTzB6R3ME6Y%3D",
"WmInfoSize": 32,
"WmInfoUint": "123456"
}Result
