Adds mosaics, Gaussian blurs, or solid color shapes to blur one or more areas of an image for privacy protection and saves the output image to the specified path in Object Storage Service (OSS).
Operation description
- Before you call this operation, make sure that you are familiar with the billing of Intelligent Media Management (IMM).****
- Make sure that the specified project exists in the current region. For more information, see Project management.
- The operation accepts JPG and PNG images with a maximum side length of 30,000 pixels and a total of up to 250 million pixels.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
imm:AddImageMosaic | none | *Project acs:imm:{#regionId}:{#accountId}:project/{#ProjectName} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ProjectName | string | Yes | test-project | |
SourceURI | string | Yes | The OSS URI of the input image. Specify the OSS URI in the oss://${Bucket}/${Object} format, where Supported formats of input images include JPG, PNG, TIFF, JP2, and BMP. | oss://examplebucket/sampleobject.jpg |
TargetURI | string | Yes | The OSS URI of the output image. Specify the OSS URI in the oss://${Bucket}/${Object} format, where | oss://examplebucket/outputImage.jpg |
ImageFormat | string | No | The encoding of the output image. By default, the output image uses the same encoding as the input image. Valid values: jpg, png, and webp. | jpg |
Quality | integer | No | The quality of the output image. This parameter applies only to JPG and WebP images. Valid values: 0 to 100. Default value: 80. | 80 |
Targets | array<object> | Yes | The bounding boxes and processing parameters. | |
object | Yes | The bounding box and the corresponding processing parameters. | ||
Type | string | Yes | The type of the mosaic effect. Valid values:
| square |
Boundary | object | Yes | The position of the bounding box. | |
ReferPos | string | No | The reference position of the bounding box on the image. Valid values:
| topleft |
X | float | Yes | The horizontal offset relative to the reference position. The value can be an integer greater than or equal to 0 or a decimal within the range of [0,1):
| 0 |
Y | float | Yes | The vertical offset relative to the reference position. The value can be an integer greater than or equal to 0 or a decimal within the range of [0,1):
| 0 |
Height | float | Yes | The height of the bounding box. The value can be an integer greater than or equal to 0 or a decimal within the range of [0,1):
| 200 |
Width | float | Yes | The width of the bounding box. The value can be an integer greater than or equal to 0 or a decimal within the range of [0,1):
| 200 |
MosaicRadius | integer | No | The radius of the mosaic. Default value: 5. Unit: pixels. Note
This parameter does not take effect for Gaussian blurs and solid color shapes.
| 5 |
BlurRadius | integer | No | The radius of the Gaussian blur. Valid values: 1 to 50. Default value: 3. Unit: pixels. Note
This parameter takes effect only for a Gaussian blur.
| 3 |
Sigma | integer | No | The standard deviation of the Gaussian blur. The value must be greater than 0. Default value: 5. Note
This parameter takes effect only for a Gaussian blur.
| 5 |
Color | string | No | The color of the color shape. You can specify a color by using a color code such as Note
This parameter takes effect only for solid color shapes.
| #FFFFFF |
CredentialConfig | CredentialConfig | No | If you do not have special requirements, leave this parameter empty. The configurations of authorization chains. For more information, see Use authorization chains to access resources of other entities. |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "CA995EFD-083D-4F40-BE8A-BDF75FF*****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|