API文档

通用抠图API获取API密钥

自动识别图像中主体轮廓,与背景进行分离,返回分割后的Alpha图、前景物体图,适应多物体,复杂背景。人像、商品、卡通、动物等等,所有明确主体的品类都可以识别分割,适应复杂背景和光线。

抠图API调用示例代码

github地址: https://github.com/picup-shop

  • cURL
  • Python
  • PHP
  • Java
  • nodejs
  • .net
  • Objective-C
  • js
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=6&crop=true' \
        -o out.png

API文档说明

请求说明

  • 请求URl: https://picupapi.tukeli.net/api/v1/matting?mattingType=6
  • 请求方式: POST
  • 返回类型: PNG图像
  • 输入参数:

    (1) 请求参数(Header)

    参数参数类型描述
    Content-Typestringmultipart/form-data
    APIKEYstring您的专属API Key

    (2) 请求参数(Body)

    参数必填
    file图片文件
    crop 是否裁剪至最小非透明区域,url参数,加在url后面,false不裁剪,true裁剪,不填写不裁剪
    bgcolor 填充背景色,url参数,加在url后面,十六进制大小RGB颜色,如FFFFFF,不填写不填充背景色
    outputFormat 输出图片格式,url参数,加在url后面,可以为png,webp,jpg_$quality($quality是压缩图片的值,为0~100之间,比如jpg_75),默认值为png

返回说明

  • 正常返回

    直接返回content-type为image/png,图片处理后的二进制文件。

  • 错误返回
    {
      "code": 1001, //
      "data": null
      "msg": '余额不足',
      "time": 1590462453264
    }

价格说明

您可以通过在线充值付费方式,购买API调用点数。

查看价格列表

注意:输入图片15M以下 API每次成功调用,消耗1点。输入图片15M~25M API每次成功调用,消耗2点

常见问题