- Media API
- Transformations
- Adjust
- extract
extract
The extract transformation isolates a single color channel (red, green, blue, or alpha) from an image and displays it as a grayscale image. Useful for analyzing channel data, creating masks, or performing advanced color operations.
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/extract:channel=CHANNEL/ASSET_ID.jpgExamples
Extract Red Channel
curl -i GET https://media.vyso.io/extract:channel=red/ASSET_ID.jpgExtract Green Channel
curl -i GET https://media.vyso.io/extract:channel=green/ASSET_ID.jpgExtract Blue Channel
curl -i GET https://media.vyso.io/extract:channel=blue/ASSET_ID.jpgExtract Alpha Channel
curl -i GET https://media.vyso.io/extract:channel=alpha/ASSET_ID.pngOn 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
channelREQUIREDColor channel to extract. Accepted values:
red- Red channel datagreen- Green channel datablue- Blue channel dataalpha- Transparency/alpha channel (if present)hue- Hue componentsaturation- Saturation componentlightness- Lightness/value component- Output displayed as grayscale image
Response
The API returns a grayscale image representing the extracted channel. 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)