History
Introduction
API Category
Making API Requests
Region APIs
Instance APIs
Cloud Hosting Cluster APIs
Image APIs
Instance Launch Template APIs
Placement Group APIs
Key APIs
Security Group APIs
Network APIs
Data Types
Error Codes
cos:GetObject, ci:CreateS3AIPicMattingJob in the authorization policy.cos:PutObject in the authorization policycos:GetObject and cos:PutObject in the authorization policy. (Note: GetObject corresponds to the source file, and PutObject corresponds to the transferred file).GET /<ObjectKey>?ci-process=AIPicMatting HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
GET /?ci-process=AIPicMatting&detect-url=<detect-url> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
Parameter | Meaning | Type | Required |
ObjectKey | Object filename, for example: folder/document.jpg | String | Yes |
ci-process | Cloud Infinite processing capability, general matting is fixed as AIPicMatting | String | Yes |
detect-url | You can fill in the detect-url to process any publicly accessible image link. If detect-url is not specified, the backend will process the ObjectKey by default. If detect-url is filled in, the backend will process the detect-url link, and there is no need to fill in the ObjectKey. Example of detect-url: http://www.example.com/abc.jpg, which needs to be UrlEncoded and processed into http%25253A%25252F%25252Fwww.example.com%25252Fabc.jpg. | String | No |
center-layout | Center the subject for matting; display centered when the value is 1, take no action when the value is 0, default is 0 | Integer | No |
padding-layout | Add padding to all four sides of the processed image, in the form of padding-layout = <dx>x<dy>. The left and right sides are padded by dx pixels each, while the top and bottom sides are padded by dy pixels each. For example: padding-layout = 20x10 Default does not perform blanking operation, maximum value of dx and dy is 1000 pixels. | String | No |
HTTP/1.1 200 OKContent-Type: image/pngContent-Length: 98645Date: Tue, 23 Apr 2022 09:06:16 GMTServer: tencent-ciStatus: 200 OKx-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****[pic-content]
PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations: <PicOperations>
Header Name | Description | Type |
Pic-Operations | Parameters for image operations | String |
Parameter | Type | Required | Description |
is_pic_info | Int | No | Whether to return original image information, 0 for no return, 1 for return, default is 0 |
rules | Array | No | Processing rules, content recognition only supports one rule |
Parameter | Type | Required | Description |
bucket | String | No | Destination bucket name for storing results, format is BucketName-AppId. If not specified, it defaults to the current bucket. |
fileid | String | Yes | Storage path and name of the processed file. Name rule description: For example, the source file path and name are: /p1/test1.jpg Absolute paths start with /, for example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder. Relative paths do not start with /, for example, when the fileid value is p2/test2.jpg, it means a new p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder. Do not end with /, otherwise an empty filename will occur. If you want the repaired image to overwrite the original image, set the fileid field to <ObjectKey> |
rule | String | Yes | Fixed as: ci-process = AIPicMatting, other processing parameters refer to during download |
Node Name (Keyword) | Parent Node | Description | Type |
UploadResult | None | Request result | Container |
Node Name (Keyword) | Parent Node | Description | Type |
OriginalInfo | UploadResult | Image information | Container |
ProcessResults | UploadResult | Request processing result | Container |
Node Name | Parent Node | Description | Type |
Key | OriginalInfo | Original image file name | String |
Location | OriginalInfo | image path | String |
ETag | OriginalInfo | Original image ETag value | String |
Node Name (Keyword) | Parent Node | Description | Type |
Object | ProcessResults | Processing result of each image | Container |
Node Name (Keyword) | Parent Node | Description | Type |
Key | Object | Image file name after matting | String |
Location | Object | Image link after matting | String |
ETag | Object | ETag value of the image after matting | String |
Size | Object | Image size after matting | Int |
PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations:{"is_pic_info": 1,"rules": [{"fileid": "exampleobject","rule": "ci-process=AIPicMatting"}]}
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 645Date: Tue, 23 Apr 2022 09:06:16 GMTStatus: 200 OKServer: tencent-cix-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****<UploadResult><OriginalInfo><Key>goods_matting.jpg</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location><ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag></OriginalInfo><ProcessResults><Object><Key>goods_matting_process.jpeg</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location><Format/><Size>354256</Size><ETag>"521451f63c331becf533e466732c1091"</ETag></Object></ProcessResults></UploadResult>
POST /<ObjectKey>?image_process HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations: <PicOperations>
Header Name | Description | Type |
Pic-Operations | Parameters for image operations | String |
Parameter Name | Type | Required | Description |
is_pic_info | Int | No | Whether to return original image information, 0 for no return, 1 for return, default is 0 |
rules | Array | No | Processing rules, one rule corresponds to one processing result (currently supports five rules), leave blank to skip image processing. |
Parameter | Type | Required | Description |
bucket | String | No | Destination bucket name for storing results, format is BucketName-AppId. If not specified, it defaults to the current bucket. |
fileid | String | Yes | Storage path and name of the processed file. Name rule description: For example, the source file path and name are: /p1/test1.jpg Absolute paths start with /, for example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder. Relative paths do not start with /, for example, when the fileid value is p2/test2.jpg, it means a new p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder. Do not end with /, otherwise an empty filename will occur. If you want the repaired image to overwrite the original image, set the fileid field to <ObjectKey> |
rule | String | Yes | Fixed as: ci-process = AIPicMatting center-layout, padding-layout, and processing during download |
Node Name (Keyword) | Parent Node | Description | Type |
UploadResult | None | Request result. | Container |
Node Name (Keyword) | Parent Node | Description | Type |
OriginalInfo | UploadResult | Image information | Container |
ProcessResults | UploadResult | Request processing result | Container |
Node Name | Parent Node | Description | Type |
Key | OriginalInfo | Original image file name | String |
Location | OriginalInfo | Original image path | String |
ETag | OriginalInfo | Original image ETag value | String |
Node Name (Keyword) | Parent Node | Description | Type |
Object | ProcessResults | Processing result of each image | Container |
Node Name (Keyword) | Parent Node | Description | Type |
Key | Object | Image file name after matting | String |
Location | Object | Image link after matting | String |
ETag | Object | ETag value of the image after matting | String |
Size | Object | Image size after matting | Int |
POST /<ObjectKey>?image_process HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-length: SizeAuthorization: Auth StringPic-Operations:{"rules": [{"fileid": "exampleobject","rule": "ci-process=AIPicMatting"}]}
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 645Date: Tue, 23 Apr 2022 09:06:16 GMTStatus: 200 OKServer: tencent-cix-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****<UploadResult><OriginalInfo><Key>goods_matting.jpg</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location><ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag></OriginalInfo><ProcessResults><Object><Key>goods_matting_process.jpeg</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location><Format/><Size>354256</Size><ETag>"521451f63c331becf533e466732c1091"</ETag></Object></ProcessResults></UploadResult>
フィードバック