LogoLogo
  • Overview
  • Quick Start
  • Authentication
  • Rate limits
  • Errors
  • Image Editing API
    • Image I/O
    • Image Operations
      • Restorations
      • Resizing
      • Outpainting
      • Generative Editing
      • Color Adjustments
      • Background
      • Padding
      • Privacy
    • API Reference
    • Async API Reference
    • Batch API Reference
    • Upload API Reference
  • image generation api
    • Image Generation I/O
    • Image Generation Options
    • API Reference
  • AI Background API
    • AI Background I/O
    • AI Background Options
      • Object
      • Scene
      • Product Shadow
    • API Reference
  • Image to Video API
    • Image to Video I/O
    • Image to Video Options
    • Async API Reference
  • Storage Connectors
    • Overview
    • AWS S3
    • Google Cloud Storage
    • Web Folder
    • API Reference
  • Guides
    • E-commerce
    • Real Estate
    • Printing
  • Redoc
  • Blog
Powered by GitBook
On this page
  • Input
  • Output
Edit on GitHub
  1. Image Editing API

Image I/O

PreviousErrorsNextImage Operations

Last updated 11 hours ago

Input

Our API supports several options to provide source images that need to be processed.

HTTP(S) URL

URL of the input image should be from 1 to 512 characters. The image must be accessible by our system.

{
    "input": "https://letsenhance.io/docs/assets/samples/burger.jpg"
}

Image upload

Our API also supports the ability to upload image content directly. Just make sure that all respective headers are set. See for more info.

Connected storage

You can connect and use it as a source for images. Currently, our API supports AWS S3 and Google Cloud Storage.

After connecting your Cloud Storage, you can refer the storage name as an input.

{
    "input": "storage://storage-name/path/image-name.jpg"
}

Input image file types

Our API supports the following image formats as inputs: BMP, GIF, JPEG, PNG, TIFF, WEBP, AVIF, and HEIC.

Output

Configuration of result output is optional.

By default, you may omit the output option from the request payload. In this case, our system stores the result in a temporary bucket with a lifespan of 24 hours and provides a public URL to the image.

Output image file types

The following image formats are supported for the output: JPEG, PNG, TIFF, WEBP and AVIF.

Basic and advanced output options

{
    "output": "storage://storage-name/result-path/image-name.jpg"
}
"output": {
    "destination": "storage://storage-name/result-path/image-name.jpg",
    "format": "jpeg",
    "metadata": {
        "dpi": 300,
        "color_space": {
            "type": "CMYK",
            "color_profile": "ISO_Coated"
        }
    }
}
"output": {
    "destination": "storage://storage-name/result-path/image-name.jpg",
    "format": {
        "type": "jpeg",
        "quality": 85,
        "progressive": true
    }
}

See the full list of the advanced format-specific options below:

Name
Type
Description

quality

integer

Specifies the amount of JPEG lossy compression in the range 1 - 100. Defaults to 85.

progressive

boolean

Progressive JPEG loads in a browser in successive waves until a clear picture is formed, thus improving the image loading speed. Used by default.

Name
Type
Description

compression

string

Indicates compression effort that will be applied during the PNG image encoding. Should have one of the values:

  • fast is used to apply minimum compression resulting in a bigger image size but less processing time.

  • best is used to apply maximum compression resulting in a smaller image size but more processing time.

  • optimal is the default and used to balance between compression effort and processing time.

Name
Type
Description

compression

string, object

The TIFF codec supports both lossless and lossy modes of operation, so you can select the one that is appropriate for your goals. Should have one of the values:

  • lossy is used to apply lossy compression to significantly reduce the image size in exchange for some loss of data, reducing the quality of an image. JPEG compression is used.

  • {"type": "lossy", "quality": 1..100} is used to apply lossy compression and specify the amount of loss you are willing to accept. Defaults to 75.

  • lossless is used to apply lossless compression to preserve maximum image detail in exchange for a significantly increased file size. Lempel–Ziv–Welch (LZW) compression is used.

By default, lossless is used if compression is not selected.

Name
Type
Description

compression

string, object

The AVIF codec supports both lossless and lossy modes of operation, so you can select the one that is appropriate for your goals. Should have one of the values:

  • lossy is used to apply lossy compression to significantly reduce the image size in exchange for some loss of data, reducing the quality of an image.

  • {"type": "lossy", "quality": 1..100} is used to apply lossy compression and specify the amount of loss you are willing to accept. Defaults to 50.

  • lossless is used to apply lossless compression to preserve maximum image detail in exchange for a significantly increased file size.

Name
Type
Description

compression

string, object

The WEBP format supports both lossless and lossy modes of operation, so you can select the one that is appropriate for your goals. Should have one of the values:

  • lossy is used to apply lossy compression to significantly reduce the image size in exchange for some loss of data, reducing the quality of an image.

  • {"type": "lossy", "quality": 1..100} is used to apply lossy compression and specify the amount of loss you are willing to accept. Defaults to 75.

  • lossless is used to apply lossless compression to preserve maximum image detail in exchange for a significantly increased file size.

Color space

"output": {
    "destination": "storage://storage-name/result-path/image-name.jpg",
    "metadata": {
        "color_space": "RGB"
    }
}
Name
Type
Description

RGB

string

Is the color space for digital images. Use the RGB color mode if your image is supposed to be displayed on any kind of screen.

CMYK

string

Is the color space for printed materials. Use CMYK for any image that will be physically printed, not viewed on a screen.

For CMYK color space, you also can specify the color profile that will be applied to the image.

"output": {
    "destination": "storage://storage-name/result-path/image-name.jpg",
    "metadata": {
        "color_space": {
            "type": "CMYK",
            "color_profile": "ISO_Coated"
        }
    }
}
Name
Type
Description
TAC *
Characterisation data

ISO_Coated

string

Standard for glossy and matte coated paper (grades 1 and 2).

330%

Coated FOGRA39 ISO 12647-2:2004

ISO_Uncoated

string

Standard for uncoated white natural paper (grade 4).

300%

Uncoated FOGRA29 ISO 12647-2:2004

USWeb_Coated

string

Standard for glossy and matte coated paper in the United States (grades 1, 2, 3 and 4).

300%

SWOP2006 Coated3v2 CGATS TR003

USWeb_Uncoated

string

Standard for uncoated white natural paper in the United States (grade 4).

260%

GRACoL 2013 Uncoated CGATS21-2-CRPC3

* "Total Area Coverage” – or TAC for short – refers to the amount of ink coverage called for in a given area of an image. It's calculated by summing the Cyan, Magenta, Yellow and Black percentages in that area.

Color space is only supported in JPEG format.

Alternatively, you can use a connected : just configure the path to the folder where you want to store results.

Upload API Reference
Cloud Storage
Cloud Storage