Images
Endpoints for retrieving and on-the-fly resizing of image assets.
/images/{assetId}
Get or resize image
Retrieve an image asset, optionally manipulated on-the-fly. Sizes are capped at 5000 px per side and 12 megapixels overall; values above the cap are reduced, a request whose target exceeds the pixel budget returns 400. Source images above 50 megapixels are rejected. Results are cached per parameter combination and served with ETag, Last-Modified and Cache-Control, so repeat requests can be revalidated with a conditional GET.
Richiede la policyReadAccess
Parametri del percorso
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
assetId | string | The asset ID (GUID) of the image |
Parametri della query
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
width | integer | — | Desired width in pixels, 0 or omitted to derive it from the height. |
height | integer | — | Desired height in pixels, 0 or omitted to derive it from the width. |
resizeType | string | — | How the image is fitted to the requested size: AspectFill (default, crops to fill), AspectFit (fits inside), Fill (stretches). |
resizePosition | string | — | Anchor used when cropping: Center (default), Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight. |
quality | integer | — | Encoding quality, 1-100. Values outside the range are clamped. Applied to JPEG, WebP and AVIF output only. |
format | string | — | Convert the output format: Webp or Avif. Omit to keep the original format. |
autoRotate | boolean | — | Apply the orientation stored in the image metadata. |
rotateDegree | number | — | Clockwise rotation in degrees, normalized to 0-360. |
flip | string | — | Mirror the image: Horizontal or Vertical. |
filter | string | — | Apply a filter: BlackWhite, GreyScale, Invert, Lomograph, Polaroid, Sepia. |
alpha | number | — | Opacity, 0-1 (0 = transparent, 1 = opaque). Out of range returns 400. |
brightness | number | — | Brightness multiplier, >= 0 (0 = black, 1 = unchanged). Negative values return 400. |
contrast | number | — | Contrast multiplier, >= 0 (0 = flat grey, 1 = unchanged). Negative values return 400. |
saturation | number | — | Saturation multiplier, >= 0 (0 = greyscale, 1 = unchanged). Negative values return 400. |
backgroundColorHex | string | — | Background color as hexadecimal (RGB, RGBA, RRGGBB or RRGGBBAA, with or without #). Anything else returns 400. |
vignetteColorHex | string | — | Vignette color, same hexadecimal formats as backgroundColorHex. |
Risposte
(binary) | binary | Raw image bytes |
Esempi di codice
curl -X GET "https://api.contit.cloud/images/{assetId}" \
-H "X-Api-Key: YOUR_API_KEY"
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var response = await http.GetAsync("https://api.contit.cloud/images/{assetId}");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
"https://api.contit.cloud/images/{assetId}",
{
method: "GET",
headers: {
"X-Api-Key": "YOUR_API_KEY",
}
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
response = requests.get(
"https://api.contit.cloud/images/{assetId}",
headers=headers
)
data = response.json()
GET /images/c3d4e5f6-a7b8-9012-cdef-123456789012?width=300&height=200&quality=85
(binary image data — Content-Type: image/png)
/images/bypath/{path}
Get image by path
Retrieve an image asset by its storage path, optionally manipulated on-the-fly. Sizes are capped at 5000 px per side and 12 megapixels overall; values above the cap are reduced, a request whose target exceeds the pixel budget returns 400. Source images above 50 megapixels are rejected. Results are cached per parameter combination and served with ETag, Last-Modified and Cache-Control, so repeat requests can be revalidated with a conditional GET.
Richiede la policyReadAccess
Parametri del percorso
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
path | string | The storage path of the image (e.g. 'products/hero-banner.jpg') |
Parametri della query
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
width | integer | — | Desired width in pixels, 0 or omitted to derive it from the height. |
height | integer | — | Desired height in pixels, 0 or omitted to derive it from the width. |
resizeType | string | — | How the image is fitted to the requested size: AspectFill (default, crops to fill), AspectFit (fits inside), Fill (stretches). |
resizePosition | string | — | Anchor used when cropping: Center (default), Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight. |
quality | integer | — | Encoding quality, 1-100. Values outside the range are clamped. Applied to JPEG, WebP and AVIF output only. |
format | string | — | Convert the output format: Webp or Avif. Omit to keep the original format. |
autoRotate | boolean | — | Apply the orientation stored in the image metadata. |
rotateDegree | number | — | Clockwise rotation in degrees, normalized to 0-360. |
flip | string | — | Mirror the image: Horizontal or Vertical. |
filter | string | — | Apply a filter: BlackWhite, GreyScale, Invert, Lomograph, Polaroid, Sepia. |
alpha | number | — | Opacity, 0-1 (0 = transparent, 1 = opaque). Out of range returns 400. |
brightness | number | — | Brightness multiplier, >= 0 (0 = black, 1 = unchanged). Negative values return 400. |
contrast | number | — | Contrast multiplier, >= 0 (0 = flat grey, 1 = unchanged). Negative values return 400. |
saturation | number | — | Saturation multiplier, >= 0 (0 = greyscale, 1 = unchanged). Negative values return 400. |
backgroundColorHex | string | — | Background color as hexadecimal (RGB, RGBA, RRGGBB or RRGGBBAA, with or without #). Anything else returns 400. |
vignetteColorHex | string | — | Vignette color, same hexadecimal formats as backgroundColorHex. |
Risposte
(binary) | binary | Raw image bytes |
Esempi di codice
curl -X GET "https://api.contit.cloud/images/bypath/{path}" \
-H "X-Api-Key: YOUR_API_KEY"
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var response = await http.GetAsync("https://api.contit.cloud/images/bypath/{path}");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
"https://api.contit.cloud/images/bypath/{path}",
{
method: "GET",
headers: {
"X-Api-Key": "YOUR_API_KEY",
}
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
response = requests.get(
"https://api.contit.cloud/images/bypath/{path}",
headers=headers
)
data = response.json()
GET /images/bypath/products/hero-banner.jpg?width=800&quality=90
(binary image data — Content-Type: image/jpeg)