Remove Background (Basic plan)
POST
/v1/segmentRemove background from an image
请求参数
Body 参数multipart/form-data
image_file
file
可选
The image file to render
format
enum<string>
Format
The format of the resulting image
枚举值:
pngjpgwebp
默认值:
png
示例值:
png
channels
enum<string>
Channels
The channels of the resulting image
枚举值:
rgbaalpha
默认值:
rgba
示例值:
rgba
bg_color
string
Background Color
The background color of the resulting image. Can be a hex code (#FF00FF
) or a HTML color (red
, green
, etc.)
size
enum<string>
Size
Will resize the output to the specified size. Can be preview
(0.25 Megapixels), medium
(1.5 MP), hd
(4 MP) or full
(36 MP, can be slower for large images). Useful for mobile apps that need smaller images.
枚举值:
previewmediumhdfull
默认值:
full
示例值:
full
crop
enum<string>
Crop
If true
, the image returned is cropped to the cutout border. Transparent pixels are removed from the border
枚举值:
truefalse
默认值:
false
示例值:
false
示例代码
返回响应
OK(200)
Bad Request(400)
Payment Required(402)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
base64img
string <base64>
Base64 encoded image
示例
未设置
最后修改时间: 8 个月前