Background Remover
Hapus latar belakang foto secara otomatis.
Base URL
https://use.api.co.id
Kirim gambar sebagai multipart/form-data (field file) atau lewat URL gambar, dengan header x-api-co-id. Response berupa gambar PNG transparan tanpa latar belakang.
Format file & batas
| Ketentuan | Nilai |
|---|---|
| Format input | JPG, JPEG, PNG, WEBP |
| Ukuran maksimal | 10 MB |
| Format output | PNG (dengan transparansi) |
Model
Pilih model lewat parameter model (default: u2netp). Model yang didukung: u2net, u2netp, silueta, isnet-general-use.
Parameter lanjutan
| Parameter | Fungsi | Default |
|---|---|---|
a | Aktifkan alpha matting | false |
af | Foreground threshold (0–255) | 240 |
ab | Background threshold (0–255) | 10 |
ae | Erode size | 10 |
om | Hanya kembalikan mask | false |
ppm | Post-process mask | false |
bgc | Warna latar dalam format R,G,B,A (mis. 255,255,255,255) | — |
extras | Parameter tambahan dalam JSON | — |
Batas penggunaan
| Paket | Kuota |
|---|---|
| Free | 20 request per bulan |
| Premium | 1000 request per bulan |
Remove Background from URL
GET/bg-remover/remove
Remove background from an image by providing its URL. Returns processed image with background removed as PNG (with transparency).
Query parameter
| Nama | Tipe | Keterangan |
|---|---|---|
urlWajib | string | URL of the image to process Contoh: https://example.com/image.jpg |
modelOpsional | string | Model name (u2net, u2netp, silueta, isnet-general-use) |
aOpsional | boolean | Enable Alpha Matting (true/false) |
afOpsional | integer | Foreground Threshold (0-255) |
abOpsional | integer | Background Threshold (0-255) |
aeOpsional | integer | Erode Size |
omOpsional | boolean | Only Mask (true/false) |
ppmOpsional | boolean | Post Process Mask (true/false) |
bgcOpsional | string | Background Color in format R,G,B,A (e.g., "255,255,255,255") |
extrasOpsional | string | Extra JSON parameters |
Request
curl -X GET "https://use.api.co.id/bg-remover/remove?url=https%3A%2F%2Fexample.com%2Fimage.jpg" \ -H "x-api-co-id: $API_CO_ID_KEY"Response
{ "is_success": false, "message": "url parameter is required", "data": null}Remove Background from File
POST/bg-remover/remove
Remove background from an uploaded image file. Maximum file size: 10 MB. Supported formats: JPG, JPEG, PNG, WEBP.
Body (multipart/form-data)
| Nama | Tipe | Keterangan |
|---|---|---|
fileWajib | file | Image file to process. Maximum size: 10 MB. Supported formats: JPG, JPEG, PNG, WEBP |
modelOpsional | string | Model name (u2net, u2netp, silueta, isnet-general-use) |
aOpsional | boolean | Enable Alpha Matting |
afOpsional | integer | Foreground Threshold (0-255) |
abOpsional | integer | Background Threshold (0-255) |
aeOpsional | integer | Erode Size |
omOpsional | boolean | Only Mask |
ppmOpsional | boolean | Post Process Mask |
bgcOpsional | string | Background Color in format R,G,B,A (e.g., "255,255,255,255") |
extrasOpsional | string | Extra JSON parameters |
Request
curl -X POST "https://use.api.co.id/bg-remover/remove" \ -H "x-api-co-id: $API_CO_ID_KEY" \ -F "[email protected]" \ -F "model=<model>" \ -F "a=<a>" \ -F "af=<af>" \ -F "ab=<ab>" \ -F "ae=<ae>" \ -F "om=<om>" \ -F "ppm=<ppm>" \ -F "bgc=<bgc>" \ -F "extras=<extras>"Response
{ "is_success": false, "message": "File is required. Please upload an image file using 'file' field in multipart/form-data", "data": null}List Available Models
GET/bg-remover/models
Get list of available background removal models.
Request
curl -X GET "https://use.api.co.id/bg-remover/models" \ -H "x-api-co-id: $API_CO_ID_KEY"Response
{ "is_success": true, "message": "Success", "data": { "models": [ "u2net", "u2netp", "silueta", "isnet-general-use" ], "default": "u2netp" }}Apakah halaman ini membantu?