Imgix APIsRendering APIGradient and FadeGradient Mask

Gradient Mask

gradient-mask

The gradient-mask parameter changes what the gradient does: instead of painting colors over the picture, the gradient becomes a mask and the picture itself fades out along it. It is a boolean and defaults to false.

With a mask, only the gradient’s alpha matters — the colors themselves are not drawn. ffffffff,00ffffff fades the picture from fully opaque to fully transparent; the white is irrelevant.

This is how you dissolve a hero image into the page behind it, rather than laying a scrim on top of it.

A normal gradient paints over the picture
sandbox-demo
gradient-mask=true fades the picture out instead
sandbox-demo

With a mask on, gradient-cs, gradient-hue, gradient-mode and gradient-alpha are not read.

The faded area is only transparent if the output format carries alpha. On JPEG it fades into bg, which defaults to white, and bg=ffffff then appears in X-Imgix-Params. Under auto=format a JPEG source stays JPEG and fades to white. Request fm=png for a genuinely transparent fade, or set bg to the color of the page.