Contrast refers to the measurement of different brightness levels between the brightest white and the darkest black of an image, that is, the grayscale contrast of an image. You can use contrast parameter to adjust the contrast of the source images stored in OSS. This topic describes the parameters and examples to adjust the contrast for an image.
Parameters
Operation name: contrast
Parameter | Description | Valid value |
---|---|---|
[value] | The contrast of the image. | [-100,100]
|
Examples
You can process images by using object URLs, OSS SDKs, or API operations. In this example, object URLs are used. For more information about how to use OSS SDKs and API operations to process images, see IMG implementation modes.
The oss-console-img-demo-cn-hangzhou bucket that is located in the China (Hangzhou) region is used as an example. Public endpoint of the image:
- Reduce the contrast by 50
The URL used to process the image is in the following format: https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=image/contrast,-50
- Increase the contrast by 50
The URL used to process the image is in the following format: https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=image/contrast,50