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.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
imm:AddImageMosaic |
none |
*Project
|
None | 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. Valid values:
|
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. |
|
|
array<object> |
No |
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 |
number |
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 |
number |
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 |
number |
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 |
number |
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 authorization chain settings. For more information, see Use authorization chains to access resources of other entities. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
CA995EFD-083D-4F40-BE8A-BDF75FF***** |
Examples
Success response
JSON format
{
"RequestId": "CA995EFD-083D-4F40-BE8A-BDF75FF*****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.