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
  • Introduction
  • How Claid API can help
  • API guide
Edit on GitHub
  1. Guides

E-commerce

PreviousAPI ReferenceNextReal Estate

Last updated 1 year ago

Introduction

Photos are an integral part of any customer’s experience. have shown that having high-quality images improves conversion, allowing the customer to see what exactly they are ordering and giving greater confidence in the platform and goods offered.

Online businesses spend a lot of resources working with digital assets like product photos. This is especially true for marketplaces that rely on user-generated content(UGC). UGC often needs to be moderated and edited due to quality reasons; there's very little control over image quality, more specifically image dimensions, compression, inconsistent backgrounds, varying aspect ratios, and light conditions.

As a result, platforms often develop their own image guidelines. They often have the following points:

  • Minimum image resolution or exact resolution which platform expects

  • Required aspect ratio (eg 16:9)

  • Entire object is fully visible and well-lit

  • Background is white and the object is centered

  • Number of platform-specific points may follow

How Claid API can help

Claid API helps you to automatically edit every product image so it has the same look and feel, no matter what the original images look like: whether they're centered and perfectly aligned, vertical or horizontal, large or small, lossless or highly compressed.

Using Claid's declarative syntax you can encode your platform guidelines, and our AI will do the hard editing work automatically for you at any scale.

In the next section, we will dive deeper into the API request which processed this product collection.

API guide

Let's see an example of how Claid API helps to produce images matching your platform guidelines. Following is a sample of a product shot in a non-professional "white box" setup.

POST /v1-beta1/image/edit
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
Content-Type: application/json

{
  "input": "https://claid.ai/doc-samples/paprika.jpg",
  "operations": {
    "resizing": {
      "fit": "canvas",
      "width": 2688,
      "height": 1512
    },
    "adjustments": {
      "hdr": {
        "intensity": 100
      },
      "sharpness": 25
    },
    "padding": "20%",
    "restorations": {
      "upscale": "smart_enhance"
    },
    "background": {
      "remove": {
        "clipping": true
      }
    }
  },
  "output": {
    "format": {
      "type": "jpeg",
      "quality": 85,
      "progressive": true
    }
  }
}
curl -X POST --location "https://api.claid.ai/v1-beta1/image/edit" \
    -H "Host: api.claid.ai" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -d "{
          \"input\": \"https://claid.ai/doc-samples/paprika.jpg\",
          \"operations\": {
            \"resizing\": {
              \"fit\": \"canvas\",
              \"width\": 2688,
              \"height\": 1512
            },
            \"adjustments\": {
              \"hdr\": {
                \"intensity\": 100
              },
              \"sharpness\": 25
            },
            \"padding\": \"20%\",
            \"restorations\": {
              \"upscale\": \"smart_enhance\"
            },
            \"background\": {
              \"remove\": {
                \"clipping\": true
              }
            }
          },
          \"output\": {
            \"format\": {
              \"type\": \"jpeg\",
              \"quality\": 85,
              \"progressive\": true
            }
          }
        }"

background block specifies that the object in the image should be separated from the background, and clipping: true states that we should clip using object bounds. The new image canvas is set using the resizing block described above.

restorations block switches on the enhancement algorithm called smart_resize which is a great option for the majority of e-commerce use cases. Another good option to try would be smart_enhance algorithm which can produce sharper images in some cases.

And following is a Claid API request which produces this result. We will show the request, and further explain the options used to obtain this result. Please visit for a full reference on Claid API parameters.

input is an original image url. output block states that we want to create a progressive JPEG with a pretty high-quality factor. In the API response we will receive a temporary URL of a resulting image. Please consult for explanation of this block, and section if you want to connect Claid API directly with your Cloud Storage in a secure way.

resizing block describes the image size which is set according to the platform guidelines. Here we specify that we want to have an image with 2688x1512px resolution, which is placed on a canvas. See section to learn about this and other supported options.

adjustments specifies color adjustments applied to an image. Here we have an ML-powered hdr algorithm applied with 100% intensity which intelligently tunes colors and shadows, and we also manually increased sharpness a bit. section describes this in detail.

padding sets amount of space around the object expressed as a percentage of the overall canvas. See the section.

Image Processing API
Image I/O
Storages
Resizing
Color Adjustments
Padding
Multiple studies
Typical image moderation scenario
Original image (3024x4032, iPhone photo)
Claid API result(2688x1512, Web-ready)