Image Retouch

Get API Key

Remove unwanted area and fill the hole with content that is consistent with the remaining regions of the image. Remove any undesired elements including passers-by, clutter, trash cans, power lines, skin blemishes, scratches, text, etc.

Image Retouch API Call Sample Code

  import requests

  requestBody = {
      "base64": "/9j/4AAQSkZJRgABAQEA...",
        "rectangles": [
            "height": 100,
            "width": 100,
            "x": 160,
            "y": 280
  response =
      headers={'APIKEY': 'INSERT_YOUR_API_KEY_HERE','Content-Type': 'application/json'},
  $host = "";
  $path = "/api/v1/imageFix";
  $method = "POST";
  $headers = array();
  array_push($headers, "APIKEY:".APIKEY);
  //Define the corresponding Content-Type according to the requirements of the API
  array_push($headers, "Content-Type".":"."application/json; charset=UTF-8");
  $querys = "";
  $requestBody = array(

  $bodyStr = json_encode($requestBody);
  $url = $host . $path;
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($curl , CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl , CURLOPT_POST, 1);

  curl_setopt($curl, CURLOPT_POSTFIELDS, $bodyStr);

  $res = curl_exec($curl);
  private RestTemplate restTemplate;

  //Construct request json
  String base64 = "/9j/4AAQSkZJRgAB...";
  HashMap<String,Object> jsonObject = new LinkedHashMap<>();
  List<HashMap<String,Object>> rectangles = new ArrayList<>();
  HashMap<String,Object> rectangle = new HashMap<>();

  //Set request header
  HttpHeaders headers = new HttpHeaders();
  headers.set("APIKEY", "YOUR_API_KEY_HERE");
  HttpEntity<String> request = null;
  try {
      String requestBody = objectMapper.writeValueAsString(jsonObject);
      request = new HttpEntity(requestBody , headers);
  } catch (JsonProcessingException e) {

  String api = "";
  long startTime = System.currentTimeMillis();

  HashMap result = restTemplate.postForObject(api , request, HashMap.class);

  //todo: your logic to deal with result

API documentation

Request description

Input parameters:

(1) Request parameters (Header)

ParameterParameter TypeDescription
APIKEYstringYour API Key

Get API Key

(2) Request parameters (Body)

      "base64": "/9j/4AAQSkZJRgABAQEA...", //Convert image file to base64 string
      "rectangles": [ //Rectangular mask area, support multiple arrays
          "height": 100,
          "width": 100,
          "x": 160,
          "y": 280
          "height": 100,
          "width": 100,
          "x": 560,
          "y": 680
      //User-provided mask image file converted to base64 string, compatible with single-channel, three-channel, and four-channel black and white images. The area to be repaired is in white and the areas to be untouched are in black. If this entry is provided, the “rectangles” parameter is ignored. 
      "maskBase64": "/9j/4AAQSkZJRgABAQEA..." 

Examples of input picture and mask picture:

input picture:


mask picture:


Response description

  • Return parameter Return json format data
    "code": 0,
    "data": {
        "status": "success",
        "imageUrl": "" //Result of image retouch url connection
    "msg": null,
    "time": 1595910561072


Purchase API calls online.

Review pricing plans

  • Note: Each successful photo retouch API call costs 1 credit.

Frequently asked questions

  • Q: What are the requirements for the input image format?
  • A: Support PNG, JPG, JPEG, BMP, WEBP
  • Q: Is there a limit to the supported image size?
  • A: The maximum resolution uploaded at present is 4096x4096 pixels, and the image file size is less than 15MB
  • Q: Request QPS limit?
  • A: Supports 5 simultaneous requests per second