Autoenhance.ai
  • Overview
  • Getting Started
    • Obtaining an API key
    • Quickstart
      • Single Image
      • HDR Brackets
    • Code Examples
      • JavaScript
        • Uploading Single Bracket
        • Uploading HDR
        • Uploading 360
      • API Integrations Repository
  • SDKs
    • Web (Beta)
      • Changelog
    • JavaScript
      • Changelog
    • Python
      • Changelog
  • File & Camera Guidelines
    • File Formats
    • Metadata
    • 360
    • Lens Correction
  • Images
    • Managing Images
      • Creating & Uploading
      • Reprocessing
      • Retrieveing
      • Deleting
      • Reporting
    • Settings
      • Enhancement Style
      • Sky Replacement
      • Lens Correction
      • Vertical Correction
      • Window Pull
      • Auto Privacy
      • Usage Example
    • Downloading Images
      • Original
      • Preview
      • Enhanced
  • Orders
    • Managing Orders
      • Creating
      • Editing
      • Retrieving
      • Listing and Pagination
      • Deleting
    • Grouping Brackets and Processing Orders
  • Webhooks
  • API Versions
  • AI Versions
  • Links
    • API Specification
    • Support
Powered by GitBook
On this page
  1. Images
  2. Managing Images

Reprocessing

This API endpoint allows you to reprocess any image you own. To reprocess an image, you must provide the image_id and a valid API key.

Important note

All preferences that you don't specify will default to the previously set preferences of your image from the last time it was enhanced.

const apiKey = "YOUR_API_KEY";
const imageId = "ID_OF_YOUR_IMAGE";
const preferences = {
  ai_version: "4.x",
  enhance: true,
  enhance_type: 'neutral',
  hdr: true
}

const processImage = async (imageId, apiKey, preferences) => {
    const processImageResponse = await fetch(
      `https://api.autoenhance.ai/v3/images/${imageId}/process`,
      {
        method: "PATCH",
        headers: {
          "Content-Type": "application/json",
          "x-api-key": apiKey,
        },
        body: JSON.stringify({
          ...preferences
        }),
      }
    );

    const data = await processImageResponse.json();
}
import requests

api_key = "YOUR_API_KEY"
image_id = "ID_OF_YOUR_IMAGE"
preferences = {
    "ai_version": "4.x",
    "enhance": True,
    "enhance_type": "neutral",
    "hdr": True
}

def edit_image(api_key, image_id, preferences):
    url = f"https://api.autoenhance.ai/v3/images/{image_id}/process"
    headers = {
        "Content-Type": "application/json",
        "x-api-key": api_key,
    }
    payload = {
        **preferences
    }
    
    response = requests.patch(url, headers=headers, json=payload)
    response_data = response.json()

    return response_data
$image_id = "ID_OF_YOUR_IMAGE";
$api_key = "YOUR_API_KEY";
$preferences = array(
    'ai_version' => '4.x',
    'enhance' => true,
    'enhance_type' => 'neutral',
    'hdr' => true
);

function process_image($image_id, $api_key, $preferences) {
    $url = "https://api.autoenhance.ai/v3/images/$image_id/process";

    $options = array(
        'http' => array(
            'header'  => "Content-Type: application/json\r\n" .
                         "x-api-key: $api_key",
            'method'  => 'PATCH',
            'content' => json_encode($preferences),
        ),
    );

    $context  = stream_context_create($options);
    $result = file_get_contents($url, false, $context);

    if ($result === FALSE) {
        return 'Error processing image';
    }

    $data = json_decode($result, true);
    // Process the $data as needed
    return $data;
}
curl -X PATCH \
  https://api.autoenhance.ai/v3/images/ID_OF_YOUR_IMAGE/process \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
        "ai_version": "4.x",
        "enhance": true,
        "enhance_type": "neutral",
        "hdr": true
      }'

The response after successfully editing or reprocessing an image will contain all the details of your image with the uploaded values.

Specification

PreviousCreating & UploadingNextRetrieveing

Last updated 5 months ago

  • Specification
  • POSTProcess Image

Process Image

post
Authorizations
Path parameters
idstringRequired
Body
ai_versionstring · enumOptional

The version of the AI model to use for enhancing the image. Versions ending in an .x will use the latest minor version as soon as it's published.

cloud_typestring · enum | nullableOptional

The type of clouds in the new sky to replace the original sky with. Options include: CLEAR, LOW_CLOUD, HIGH_CLOUD

Possible values:
enhancebooleanOptional

Whether to enhance the image.

Default: true
enhance_typestring · enumOptional

The type of enhancement to apply to the image. PROPERTY or PROPERTY_USA is used with AI version < 4.0, for >= 4.0 use WARM or NEUTRAL..

Possible values:
image_namestringOptional
lens_correctionbooleanOptional

Correct any lens distortion in the image.

Default: true
order_idstringOptional
privacyboolean | nullableOptional

Whether to blur any faces or license plates in the image.

ratinginteger · max: 5Optional

A rating between 0 and 5 on how good the image enhancmeent. Higher is better.

sky_replacementbooleanOptional

Enable the replacement of the original sky for a summer sky.

threesixtybooleanOptional

Whether the image is a 360 image.

upscalebooleanOptional

Whether to upscale the image.

vertical_correctionbooleanOptional

Correct any vertical distortion in the image so that it appears straight.

Default: true
window_pullboolean | nullableOptional

Whether to pull the windows in the image (used with AI version >= 4.0).

Other propertiesanyOptional
Responses
200
Successful response
application/json
401
Authentication error
application/json
404
Not found
application/json
422
Validation error
application/json
post
POST /v3/images/{id}/process HTTP/1.1
Host: api.autoenhance.ai
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 359

{
  "ai_version": "text",
  "cloud_type": "CLEAR",
  "enhance": true,
  "enhance_type": "property",
  "image_name": "text",
  "lens_correction": true,
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "order_id": "text",
  "privacy": true,
  "rating": 1,
  "sky_replacement": true,
  "threesixty": true,
  "upscale": true,
  "vertical_correction": true,
  "window_pull": true,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "ai_version": "text",
  "cloud_type": "CLEAR",
  "date_added": 1,
  "downloaded": true,
  "enhance": true,
  "enhance_type": "property",
  "image_id": "123e4567-e89b-12d3-a456-426614174000",
  "image_name": "text",
  "lens_correction": true,
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "order_id": null,
  "privacy": true,
  "rating": 1,
  "scene": "text",
  "sky_replacement": true,
  "status": null,
  "status_reason": null,
  "upscale": true,
  "user_id": null,
  "vertical_correction": true,
  "window_pull": true,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}