Get API Key

Normal return


{
    "code": 0,
    "data": {
        "imageBase64: "iVBORw0KGgo..." //base64 encoded of the image 
    },
    "msg": null,
    "time": 1590462453264
}

Error

{
  "code": 1001, //
  "data": null
  "msg": 'Insufficient balance',
  "time": 1590462453264
}

Gamma API

1a. Adjust gamma (Binary stream)

ParameterTypeDescription
nameStringType of work
gammaIntegerGamma value

Sample code

Curl

curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
  -F 'file=@/path/to/file.jpg'     \
  -f 'https://www.cutout.pro/v1/matting2?mattingType=6&crop=true' \
  -o out.png

Python

  import requests
  response = requests.post(
    'https://www.cutout.pro/v1/matting2?mattingType=6',
    files={'file': open('/path/to/file.jpg', 'rb')},
    headers={'APIKEY': 'INSERT_YOUR_API_KEY_HERE'},
  )

Node.js

FIXED
  var request = require('request');
  var fs = require('fs');

  request.post({
    url: 'https://www.cutout.pro/v1/matting2?mattingType=6',
    formData: {
    file: fs.createReadStream('/path/to/file.jpg')
    },
    headers: {
    'APIKEY': 'INSERT_YOUR_API_KEY_HERE'
    },
    encoding: null
  }, function(error, response, body) {
    // console.log(response);
  });

Request description

Response description

Normal return


{
    "code": 0,
    "data": {
        "imageBase64: "iVBORw0KGgo..." //base64 encoded string of the
image with background removed
    },
    "msg": null,
    "time": 1590462453264
}

Error

{
  "code": 1001, //
  "data": null
  "msg": 'Insufficient balance',
  "time": 1590462453264
}

1b. Adjust gamma (Base64)

ParameterTypeDescription
nameStringType of work
gammaIntegerGamma value

Sample code

Curl

curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
  -F 'file=@/path/to/file.jpg'     \
  -f 'https://www.cutout.pro/v1/matting2?mattingType=6&crop=true' \
  -o out.png

Python

  import requests
  response = requests.post(
    'https://www.cutout.pro/v1/matting2?mattingType=6',
    files={'file': open('/path/to/file.jpg', 'rb')},
    headers={'APIKEY': 'INSERT_YOUR_API_KEY_HERE'},
  )

Node.js

  var request = require('request');
  var fs = require('fs');

  request.post({
    url: 'https://www.cutout.pro/v1/matting2?mattingType=6',
    formData: {
    file: fs.createReadStream('/path/to/file.jpg')
    },
    headers: {
    'APIKEY': 'INSERT_YOUR_API_KEY_HERE'
    },
    encoding: null
  }, function(error, response, body) {
    // console.log(response);
  });

Request description

Response description

Normal return


{
    "code": 0,
    "data": {
        "imageBase64: "iVBORw0KGgo..." //base64 encoded string of the
image with background removed
    },
    "msg": null,
    "time": 1590462453264
}

Error

{
  "code": 1001, //
  "data": null
  "msg": 'Insufficient balance',
  "time": 1590462453264
}

1c. Adjust gamma (Base64 encoded imageURL)

ParameterTypeDescription
nameStringType of work
gammaIntegerGamma value

Sample code

Curl

curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
  -F 'file=@/path/to/file.jpg'     \
  -f 'https://www.cutout.pro/v1/matting2?mattingType=6&crop=true' \
  -o out.png

Python

  import requests
  response = requests.post(
    'https://www.cutout.pro/v1/matting2?mattingType=6',
    files={'file': open('/path/to/file.jpg', 'rb')},
    headers={'APIKEY': 'INSERT_YOUR_API_KEY_HERE'},
  )

Node.js

  var request = require('request');
  var fs = require('fs');

  request.post({
    url: 'https://www.cutout.pro/v1/matting2?mattingType=6',
    formData: {
    file: fs.createReadStream('/path/to/file.jpg')
    },
    headers: {
    'APIKEY': 'INSERT_YOUR_API_KEY_HERE'
    },
    encoding: null
  }, function(error, response, body) {
    // console.log(response);
  });

Request description

Response description

Normal return


{
    "code": 0,
    "data": {
        "imageBase64: "iVBORw0KGgo..." //base64 encoded string of the
image with background removed
    },
    "msg": null,
    "time": 1590462453264
}

Error

{
  "code": 1001, //
  "data": null
  "msg": 'Insufficient balance',
  "time": 1590462453264
}

Returning JSON

curl -d "key=<XXX>" -d 'outType=JSON' -d \
...

Returning Download

curl -d "key=<XXX>" -d 'outType=Download' -d \
...

Returning Blob

curl -d "key=<XXX>" -d 'outType=Blob' \
...

Returning Base64

curl -d "key=<XXX>" -d 'outType=Base64' -d \
...

Returning PNG Image

curl -d "key=<XXX>" -d 'outType=Image' -d \
...
Back to API