Search…
E-commerce

Introduction

Photos are an integral part of any customer’s experience. And many platforms pride themselves on not only our wide variety of products offered but also on the high-quality images that are provided to customers. 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 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
Typical image moderation scenario

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 product shot in a non-professional "white box" setup.
Original image (3024x4032, iPhone photo)
Claid API result(2688x1512, Web-ready)
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.
Request JSON
cURL
1
{
2
"input": "https://claid.ai/doc-samples/paprika.jpg",
3
"operations": {
4
"resizing": {
5
"fit": "canvas",
6
"width": 2688,
7
"height": 1512
8
},
9
"adjustments": {
10
"hdr": {
11
"intensity": 100
12
},
13
"sharpness": 25
14
},
15
"padding": "20%",
16
"restorations": {
17
"upscale": "smart_resize"
18
},
19
"background": {
20
"remove": {"clipping": true}
21
}
22
},
23
"output": {
24
"format": {
25
"type": "jpeg",
26
"quality": 85,
27
"progressive": true
28
}
29
}
30
}
Copied!
1
curl -X POST -L "https://api.claid.ai/v1-beta1/image/edit" \
2
-H "Content-Type: application/json" \
3
-H "Authorization: Bearer <YOUR-API-KEY>" \
4
-d "{
5
\"input\": \"https://claid.ai/doc-samples/paprika.jpg\",
6
\"operations\": {
7
\"resizing\": {
8
\"fit\": \"canvas\",
9
\"width\": 2688,
10
\"height\": 1512
11
},
12
\"adjustments\": {
13
\"hdr\": {
14
\"intensity\": 100
15
},
16
\"sharpness\": 25
17
},
18
\"padding\": \"20%\",
19
\"restorations\": {
20
\"upscale\": \"smart_enhance\"
21
},
22
\"background\": {
23
\"remove\": { \"clipping\": true }
24
}
25
},
26
\"output\": {
27
\"format\": {
28
\"type\": \"jpeg\",
29
\"quality\": 85,
30
\"progressive\": true
31
}
32
}
33
}"
Copied!
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 blocks, 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 are set according to the platform guidelines. Here we specify that we want to have an image which is 2688x1512px in resolution(per our imaginary platform guidelines), 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 a padding which is applied around the object in percentage of 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.
Copy link
Edit on GitHub