Request
- URL:
https://www.ailabapi.com/api/cutout/general/universal-background-removal - Method:
POST - Content-Type:
multipart/form-data
Image requirements
- Image format:
JPEGJPGBMPWEBPPNG(8-bit, 16-bit, 64-bit PNG not supported) - Image size: No more than 3 MB.
- Image resolution: Greater than 32x32px, less than 2000x2000px, with the longest side equal to or less than 1999px.
Headers
| Field | Required | Type | Description |
|---|---|---|---|
ailabapi-api-key | YES | string | Application API KEY. Get API KEY |
Body
| Field | Required | Type | Scope | Description |
|---|---|---|---|---|
image | YES | file | ||
return_form | NO | string | mask, whiteBK, crop | Specifies the form of the returned image. If not set, the four-channel PNG map is returned. mask`: Returns a single channel mask.` whiteBK: Return to white background image. “crop: Returns the four-channel PNG image after cropping (cropping out the blank areas around the edges). |
Response
Public Response Fields
Viewing Public Response Fields and Error CodesBusiness Response Fields
| Field | Type | Description |
|---|---|---|
data | object | The content of the result data returned. |
+image_url | string | Resulting image URL address. |
Response Example
Sample Code
Authorizations
API Key for authentication
Body
multipart/form-data
Specifies the form of the returned image. <li>If not set, the four-channel PNG map is returned.</li> <li>mask: Returns a single channel mask.</li> <li>whiteBK: Return to white background image.</li> <li>crop: Returns the four-channel PNG image after cropping (cropping out the blank areas around the edges).</li>
Response
200 - application/json
Success
The response is of type object.

