tencent cloud

All product documents
APIs
Grayscale Image
Last updated: 2024-06-12 15:20:05
Grayscale Image
Last updated: 2024-06-12 15:20:05

Overview

COS uses CI’s imageMogr2/grayscale API to set an image to be a grayscale image.

API Format

download_url?imageMogr2/grayscale/<value>

Parameters

Operation: grayscale
Parameter
Description
download_url
URL of the input image, formatted as &lt;BucketName-APPID>.cos.&lt;Region>.myqcloud.com/&lt;picture name>
Example: examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/picture.jpeg
/grayscale/<value>
Whether to set an image to be a grayscale image.
value being 0 indicates not to modify the image.
value being 1 indicates to set the image to be a grayscale image.
/ignore-error/1
If this parameter is carried and the image failed to be processed because it is too large, the input image will be returned with no error reported.

Examples

Set an image to be a grayscale image:
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/grayscale/1
Output image:

img


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon