- Media API
- Transformations
- Adjust
- lightness
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.jpgExamples
Darker Image
curl -i GET https://media.vyso.io/lightness:value=-30/ASSET_ID.jpgSlightly Darker
curl -i GET https://media.vyso.io/lightness:value=-15/ASSET_ID.jpgBaseline (No Change)
curl -i GET https://media.vyso.io/lightness:value=0/ASSET_ID.jpgBrighter Image
curl -i GET https://media.vyso.io/lightness:value=25/ASSET_ID.jpgMuch Brighter
curl -i GET https://media.vyso.io/lightness:value=50/ASSET_ID.jpgOn 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
valueREQUIREDLightness adjustment amount. Accepted values:
- Range: -100 to 100
-50- Significantly darker-25- Moderately darker0- No change (baseline)25- Moderately brighter50- 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)