Skip to content

Assets API Reference

Image Proxy

The image proxy provides on-the-fly image resizing, cropping, and format conversion. It fetches an external image, processes it according to the specified options, and returns the result with appropriate cache headers.

Base URL

https://assets.api.easelive.tv

Endpoint

GET /api/v2/imgproxy/:accountId/:options?url=<imageUrl>

Path parameters:

  • accountId — Your Ease Live account name (lowercase alphanumeric and hyphens)
  • options — Comma-separated processing options in key=value format

Query parameters:

  • url (required) — The source image URL (must be http or https)

Options

OptionTypeValuesDefaultDescription
wnumber50, 100–2000 (multiples of 100)Output width in pixels
hnumber50, 100–2000 (multiples of 100)Output height in pixels
fitstringscaledown, scale, fill, fit, crop, face, face-and-shouldersscaledownResize mode (see below)
fillPositionstringtop-left, top, top-right, left, center, right, bottom-left, bottom, bottom-rightAnchor point for fill and fit modes
qnumber10–100 (multiples of 10)85Output quality (JPEG/WebP)
fstringjpg, jpeg, png, gif, webpsource formatOutput format
paddingnumber1–5 (max 1 decimal place)1.8 (face) / 2.8 (face-and-shoulders)Zoom multiplier for face crop region. Only applies to face and face-and-shoulders modes

TIP

The fillPosition is specified inline with fit using a colon separator: fit=fill:center

Fit modes

ModeDescription
scaledownFit within the given dimensions without enlarging. This is the default.
scaleFit within the given dimensions, may enlarge.
fillCover the given dimensions, cropping excess. Use fillPosition to control the anchor.
fitFit within the given dimensions, padding if necessary. Use fillPosition to control alignment.
cropCenter crop to the given dimensions without resizing.
faceDetect a face and crop tightly around it (1.8× face height by default). Falls back to attention-based crop if no face is detected.
face-and-shouldersDetect a face and crop to include shoulders (2.8× face height by default). Falls back to face sizing if the region extends past the image, or to attention-based crop if no face is detected.

Face-aware cropping

The face and face-and-shoulders fit modes use face detection to intelligently crop images around a person's face. This is useful for generating profile thumbnails or portrait crops from arbitrary photos.

How it works:

  1. The image is analyzed to detect faces using a landmark model (68-point).
  2. If multiple faces are found, the one closest to the image center is chosen.
  3. A crop region is calculated relative to the detected face height — 1.8× for face and 2.8× for face-and-shoulders.
  4. The region is centered on the nose landmark, then adjusted to fit the target aspect ratio.
  5. If no face is detected (or the image is animated), it falls back to an attention-based smart crop.

The padding option:

Use the padding option to override the default crop multiplier. A value of 1 crops very tightly around the face, while 5 includes much more of the surrounding area. Accepts one decimal place (e.g., 1.5, 2.3).

WARNING

Face detection is skipped for animated images (GIFs, animated WebPs). These will fall back to attention-based cropping.

Response

Headers:

HeaderDescription
Content-TypeOutput image MIME type (image/webp, image/png, etc.)
Cache-Controlpublic, max-age=5184000, s-maxage=86400 on success; public, max-age=300 on error
X-CacheHIT if served from cache, MISS if freshly processed

Status codes:

CodeDescription
200Success
403Domain not allowed or private/internal IP detected
422Validation error (invalid options or URL)
502Failed to process the upstream image
504Upstream image fetch timed out

Examples

Resize to 200px width, convert to WebP — Open example

GET /api/v2/imgproxy/my-account/w=200,f=webp?url=https://download.easelive.tv/examples/ease-live-logo.png

Resize to 700x200, fill from center, 70% quality — Open example

GET /api/v2/imgproxy/my-account/w=700,h=200,fit=fill:center,q=70?url=https://download.easelive.tv/examples/ease-live-logo.png

Small 50px thumbnail as PNG — Open example

GET /api/v2/imgproxy/my-account/w=50,f=png?url=https://download.easelive.tv/examples/ease-live-logo.png

Face crop to 400x400 — Open example

GET /api/v2/imgproxy/my-account/w=400,h=400,fit=face?url=https://download.easelive.tv/docs/assets/player.png

Face and shoulders crop to 400x500 — Open example

GET /api/v2/imgproxy/my-account/w=400,h=500,fit=face-and-shoulders?url=https://download.easelive.tv/docs/assets/player.png

Face crop with custom padding (tighter crop) — Open example

GET /api/v2/imgproxy/my-account/w=300,h=300,fit=face,padding=1.2?url=https://download.easelive.tv/docs/assets/player.png