照片上色

优质
小牛编辑
119浏览
2023-12-01

自动识别图像进行照片上色处理

模式一

返回二进制文件流

模式二

返回base64字符串

模式三

通过图片url返回base64结果

照片上色API调用示例代码

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

  • cURL
  • Python
  • PHP
  • Java
  • nodejs
  • .net
  • Objective-C
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
        -F 'file=@/path/to/file.jpg'     \
        -f 'https://picupapi.tukeli.net/api/v1/matting?mattingType=19' \
        -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=19' \
        -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=19' \
        -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=19' \
        -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=19' \
        -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=19' \
        -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=19' \
        -o out.png

API文档说明

接口描述

用户上传人像图片,服务器返回照片上色的PNG图片。

请求说明

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

    (1) 请求参数(Header)

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

    (2) 请求参数(Body)

    参数必填
    file图片文件

返回说明

  • 正常返回

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

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

照片上色API调用示例代码

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

  • cURL
  • Python
  • PHP
  • Java
  • nodejs
  • .net
  • Objective-C
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         -F 'file=@/path/to/file.jpg'     \
         -f 'https://picupapi.tukeli.net/api/v1/matting2?mattingType=19'
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         -F 'file=@/path/to/file.jpg'     \
         -f 'https://picupapi.tukeli.net/api/v1/matting2?mattingType=19'
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         -F 'file=@/path/to/file.jpg'     \
         -f 'https://picupapi.tukeli.net/api/v1/matting2?mattingType=19'
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         -F 'file=@/path/to/file.jpg'     \
         -f 'https://picupapi.tukeli.net/api/v1/matting2?mattingType=19'
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         -F 'file=@/path/to/file.jpg'     \
         -f 'https://picupapi.tukeli.net/api/v1/matting2?mattingType=19'
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         -F 'file=@/path/to/file.jpg'     \
         -f 'https://picupapi.tukeli.net/api/v1/matting2?mattingType=19'
  • curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         -F 'file=@/path/to/file.jpg'     \
         -f 'https://picupapi.tukeli.net/api/v1/matting2?mattingType=19'

API文档说明

接口描述

用户上传人像图片,服务器返回人物对应的照片上色的PNG图片。

请求说明

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

    (1) 请求参数(Header)

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

    (2) 请求参数(Body)

    参数必填
    file图片文件

返回说明

  • 正常返回
    {
        "code": 0,
        "data": {
        "imageBase64": "iVBORw0KGgo..." //返回图像的base64编码
        },
        "msg": null,
        "time": 1590462453264
    }
  • 错误返回
    {
      "code": 1001, //
      "data": null
      "msg": '余额不足',
      "time": 1590462453264
    }

照片上色API调用示例代码

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

  • cURL
  • Objective-c
  • curl -X GET --header 'Accept: application/json' \
         --header 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         'https://picupapi.tukeli.net/api/v1/mattingByUrl?url=http%3A%2F%2Fdeeplor.oss-cn-hangzhou.aliyuncs.com%2Fupload%2Fimage%2F20200721%2F6ed6a205f75d4f4c88fb403700712191.jpg&mattingType=19'
  • curl -X GET --header 'Accept: application/json' \
         --header 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
         'https://picupapi.tukeli.net/api/v1/mattingByUrl?url=http%3A%2F%2Fdeeplor.oss-cn-hangzhou.aliyuncs.com%2Fupload%2Fimage%2F20200721%2F6ed6a205f75d4f4c88fb403700712191.jpg&mattingType=19'

API文档说明

接口描述

用户上传人像图片,服务器返回照片上色的图像通过base64编码后的结果。

请求说明

  • 请求URl: https://picupapi.tukeli.net/api/v1/mattingByUrl
  • 请求方式: GET
  • 返回类型: application/json
  • 输入参数:

    (1) 请求参数(Header)

    参数参数类型描述
    APIKEYstring您的专属API Key

    (2) 请求参数(Body)

    参数必填
    mattingType抠图类型,1:人像,2:物体,3:头像,4:一键美化,6:通用抠图,11:卡通化,17: 卡通头像,18: 人脸变清晰,19: 照片上色
    url图片的url地址

返回说明

  • 正常返回
    {
        "code": 0,
        "data": {
        "imageBase64": "iVBORw0KGgo..." //返回图像的base64编码
        },
        "msg": null,
        "time": 1590462453264
    }
  • 错误返回
    {
      "code": 1001, //
      "data": null
      "msg": '余额不足',
      "time": 1590462453264
    }

价格说明

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

查看价格列表

注意:API每次成功调用,消耗2点。

常见问题

  • Q:输入的图片格式有什么要求?
  • A:支持PNG、JPG、JPEG、BMP、WEBP
  • Q:支持图片大小有限制吗?
  • A:目前上传的分辨率最大4096x4096像素,图片文件大小15MB以下