Remove Black Borders
Automatically detect and crop black borders around an image to restore the effective content area.
Prefer not to code? Upload files and process them in Gitruck Toolbox. Just sign in; results match this API.Open Image Black Border Remover →
Create Task
| Item | Value |
|---|
| Request Method | POST |
| Request Path | /task/image_blackborder_remove |
| Content-Type | application/json |
| Authentication | Raw API key in the Authorization header |
Request Body
| Parameter | Type | Required | Default | Description |
|---|
file_id | string | Yes | - | Uploaded image file ID |
Request Example
curl -X POST https://api.ai-mcn.tv:10000/task/image_blackborder_remove \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id": "537489015178246"}'
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"task_type": "image_blackborder_remove",
"status": "queued"
}
}
Query Task Result
| Item | Value |
|---|
| Request Method | GET |
| Request Path | /task/image_blackborder_remove/{task_id} |
| Authentication | Raw API key in the Authorization header |
Output Result (output_result)
| Parameter | Type | Description |
|---|
file_id | string | Processed image file ID |
original_size | string | Original size, such as "1920x1080" |
cropped_size | string | Cropped size, such as "1920x1050" |
removed_borders.top | number | Cropped pixels from the top |
removed_borders.bottom | number | Cropped pixels from the bottom |
removed_borders.left | number | Cropped pixels from the left |
removed_borders.right | number | Cropped pixels from the right |
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"file_id": "537489015178248",
"original_size": "1920x1080",
"cropped_size": "1920x1050",
"removed_borders": {
"top": 15,
"bottom": 15,
"left": 0,
"right": 0
}
},
"create_time": "2026-04-05T08:00:00Z",
"update_time": "2026-04-05T08:00:05Z"
}
}
Error Codes
| Error Code | HTTP Status | Description | Resolution |
|---|
6013 | 400 | Missing file_id | Pass the file_id field |
6014 | 400 | File type does not match the task | Upload an image file |
6004 | 404 | File not found | Verify the file_id |
6017 | 400 | The file is not a recognizable image (for example, a web page saved as .jpg, or a file whose header is cut off). It is rejected at task creation; no task is created and nothing is charged | Re-export the image as JPEG / PNG and upload it again |
6502 | 401 | Authentication failed | Check the Authorization header |
6202 | 402 | Insufficient balance | Recharge in the Dashboard |
6017 | — | The image's actual format can't be read by this API (for example, the extension is .jpg but the content is AVIF); the error message names the actual format (during execution: the task fails and credits are refunded; see error_code in the task result) | Convert the image to JPEG / PNG, upload it again and resubmit |
6021 | — | The image data is incomplete or damaged, typically truncated by an interrupted download or upload. The file header is intact, so this can't be detected at task creation (during execution: the task fails and credits are refunded; see error_code in the task result) | Re-export the image or use the original, then resubmit |