Request
- URL:
https://www.ailabapi.com/api/image/effects/image-hd-color-migration - Method:
POST - Content-Type:
multipart/form-data
Image requirements
- Image format:
PNGJPGJPEG - Image size: No more than 3 MB.
- Image resolution: Larger than 64x64px, smaller than 10000x10000px.
- The image must be RGB 3-channel.
Headers
| Field | Required | Type | Description |
|---|---|---|---|
ailabapi-api-key | YES | string | Application API KEY. Get API KEY |
Body
Fixed Fields
| Field | Required | Type | Scope | Default | Example | Description |
|---|---|---|---|---|---|---|
task_type | YES | string | async | async | “async: Asynchronous tasks. | |
image | YES | file | ||||
mode | YES | string | AUTO, TEMPLATE, REF_PIC | AUTO`: Automatic color extension.`, TEMPLATE: Color palette extension., “REF_PIC: Reference picture extension color. | ||
degree | YES | string | [0, 1] | 0.4 | Top color degree. |
mode === AUTO
| Field | Required | Type | Scope | Default | Description |
|---|---|---|---|---|---|
color_count | NO | integer | 1, 2, 3, 4, 5, 6, 7, 8 | 1 | Expand the number of color families. |
mode === TEMPLATE
| Field | Required | Type | Example | Description |
|---|---|---|---|---|
color_template | YES | string | 056A6B,0A0B0C | Color palette topology, Top master color list, color value definition ARGB. e.g. 0A0B0C, array size [1, 7]. |
mode === REF_PIC
| Field | Required | Type | Description |
|---|---|---|---|
ref | YES | file | Reference image. |
Response
Public Response Fields
Viewing Public Response Fields and Error CodesBusiness Response Fields
| Field | Type | Scope | Description |
|---|---|---|---|
task_type | string | async | Task Type. “async: Asynchronous tasks. |
task_id | string | Asynchronous task ID. Please use this field when calling the Querying Async Task Results API. |
Response Example
Querying Async Task Results Response
Public Response Fields
Viewing Public Response Fields and Error CodesBusiness Response Fields
| Field | Type | Scope | Description |
|---|---|---|---|
task_status | integer | 0, 1, 2 | Asynchronous task status. 0`: The task is queued.` 1: Asynchronous processing. “2: Processing was successful. |
data | object | The content of the result data returned. | |
+image_list | array of string | Result URL address. |
Response Example
Sample Code
Authorizations
API Key for authentication
Body
multipart/form-data
Task Type.
Example:
"async"
Color extension mode. <li>AUTO: Automatic color extension.</li> <li>TEMPLATE: Color palette extension.</li> <li>REF_PIC: Reference picture extension color.</li>
Top color degree.
Expand the number of color families.
Color palette topology, Top master color list, color value definition ARGB. e.g. 0A0B0C, array size [1, 7].
Reference image.
Response
200 - application/json
Success
The response is of type object.

