If you want to protect privacy or improve the visual effects of an image stored in Object Storage Service (OSS), you can blur the whole image or part of the image.
Scenarios
Privacy protection: Before you publish an image that contains sensitive information, such as license plate numbers and faces, you can blur part of the image.
Better visual experience for an image composed of multiple layers: Properly blurring the image can smooth the edges between different layers to provide a more comfortable visual experience.
Better display of a low-resolution image: When the resolution of an image is low and cannot meet the requirements of a high-definition display, you can blur the image.
Parameters
Operation: blur
The following table describes the parameters.
Parameter | Required | Description | Valid value |
r | Yes | The blur radius. | [1,50] A greater value specifies a blurrier image. |
s | Yes | The standard deviation of a normal distribution. | [1,50] A greater value specifies a blurrier image. |
Examples
You can use object URLs, OSS SDKs, or API operations to configure image processing (IMG) parameters that are used to process images. In this topic, object URLs are used. You can use object URLs to configure IMG parameters only for public-read and public-read-write images. If you want to configure IMG parameters for private images, use OSS SDKs or call API operations. For more information, see IMG implementation modes.
In the following examples, an image in a bucket named oss-console-img-demo-cn-hangzhou-3az in the China (Hangzhou) region is used as the source image. The image can be accessed over the Internet by using the following URL:
Blur an image
Configure the parameters based on the following requirements: If you want to set the blur radius to 10 and the standard deviation of a normal distribution to 10, add
r_10,s_10
to the URL of the image.The following URL is used to process the image: https://oss-console-img-demo-cn-hangzhou-3az.oss-cn-hangzhou.aliyuncs.com/example1.jpg?x-oss-process=image/blur,r_10,s_10