lightness

The lightness transformation adjusts the brightness of an image in the HSL color space, preserving saturation and hue. Unlike simple brightness adjustments, lightness provides perceptually uniform brightness control for more natural results.

Serving Content via CDN

The Media API is a CDN-based service that serves transformed images via GET requests. When you request a transformed image URL, the transformation is applied dynamically on the first request and then cached for subsequent requests.

URL Pattern

https://media.vyso.io/lightness:value=VALUE/ASSET_ID.jpg

Examples

Darker Image

curl -i GET https://media.vyso.io/lightness:value=-30/ASSET_ID.jpg

Slightly Darker

curl -i GET https://media.vyso.io/lightness:value=-15/ASSET_ID.jpg

Baseline (No Change)

curl -i GET https://media.vyso.io/lightness:value=0/ASSET_ID.jpg

Brighter Image

curl -i GET https://media.vyso.io/lightness:value=25/ASSET_ID.jpg

Much Brighter

curl -i GET https://media.vyso.io/lightness:value=50/ASSET_ID.jpg

On the first request, you'll receive a X-Cache: MISS header while the transformation is applied and cached. Subsequent requests will return X-Cache: HIT.

Parameters

valueREQUIRED

Lightness adjustment amount. Accepted values:

  • Range: -100 to 100
  • -50 - Significantly darker
  • -25 - Moderately darker
  • 0 - No change (baseline)
  • 25 - Moderately brighter
  • 50 - Significantly brighter
  • Preserves color saturation and hue while adjusting brightness

Response

The API returns the image with adjusted lightness value. The response format depends on the format of the asset stored in the Vyso asset cloud.

Content-Type: Determined by the stored asset format (e.g., image/jpeg, image/png)