colorBalance

The colorBalance transformation adjusts color balance independently across shadows, midtones, and highlights using cyan-red, magenta-green, and yellow-blue axes. Professional-grade color correction for correcting color casts and achieving desired color grading.

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/color-balance:cyan=C:magenta=M:yellow=Y:target=T/ASSET_ID.jpg

Examples

Warm Shadows (Add Red)

curl -i GET https://media.vyso.io/color-balance:cyan=-20:target=shadows/ASSET_ID.jpg

Cool Highlights (Add Cyan)

curl -i GET https://media.vyso.io/color-balance:cyan=20:target=highlights/ASSET_ID.jpg

Green Midtones Correction

curl -i GET https://media.vyso.io/color-balance:magenta=15/ASSET_ID.jpg

Warm Overall Tone (Yellow)

curl -i GET https://media.vyso.io/color-balance:yellow=20:target=midtones/ASSET_ID.jpg

Complex Color Grading

curl -i GET https://media.vyso.io/color-balance:cyan=-15:magenta=10:yellow=5:target=shadows/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

cyanOPTIONAL

Cyan-Red adjustment. Accepted values:

  • Range: -100 to 100
  • Negative values add cyan (cool); positive values add red (warm)
  • -20 - Add cyan coolness
  • 20 - Add red warmth
magentaOPTIONAL

Magenta-Green adjustment. Negative values add green; positive add magenta.

yellowOPTIONAL

Yellow-Blue adjustment. Negative values add blue; positive add yellow.

targetOPTIONAL

Tonal range to adjust. Accepted values:

  • shadows - Dark areas (0-⅓ brightness)
  • midtones - Mid tones (default, ⅓-⅔ brightness)
  • highlights - Bright areas (⅔-1 brightness)
  • Combine multiple targets for complete color grading

Response

The API returns the color-balanced image. 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)