E-commerce

Introduction

Photos are an integral part of any customer’s experience. Multiple studies 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.

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 Image Processing API for a full reference on Claid API parameters.

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
    }
  }
}

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 Image I/O for explanation of this block, and Storages 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 Resizing 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. Color Adjustments section describes this in detail.

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.

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

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.

Last updated