- Media API
- Transformations
- Adjust
- gamma
gamma
The gamma transformation applies gamma correction to adjust image brightness nonlinearly. Gamma correction is useful for display calibration, compensating for monitor/camera characteristics, or creating artistic lighting effects.
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/gamma:value=VALUE/ASSET_ID.jpgExamples
Dark Gamma (0.5)
curl -i GET https://media.vyso.io/gamma:value=0.5/ASSET_ID.jpgSlight Darkening (0.8)
curl -i GET https://media.vyso.io/gamma:value=0.8/ASSET_ID.jpgLinear (No Correction)
curl -i GET https://media.vyso.io/gamma:value=1.0/ASSET_ID.jpgSlight Brightening (1.2)
curl -i GET https://media.vyso.io/gamma:value=1.2/ASSET_ID.jpgBright Gamma (2.0)
curl -i GET https://media.vyso.io/gamma:value=2.0/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
valueREQUIREDGamma correction exponent. Accepted values:
- Range: 0.1 to 10.0
0.5- Strong darkening (gamma darken)0.8- Moderate darkening1.0- Linear (no correction)1.2- Moderate brightening2.0- Strong brightening (gamma brighten)- Values < 1.0 darken midtones; values > 1.0 brighten midtones
Response
The API returns the image with gamma correction applied. 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)