Imgix APIsRendering APIBackgroundColor Key Tolerance

Color Key Tolerance

colorkey-tol

The colorkey-tol parameter sets how far a pixel’s color can be from the colorkey color and still become fully transparent. It has no effect without colorkey.

The value is a distance in 8-bit sRGB color values (0–255 per channel), the same unit as trim-tol. In the default color mode it is the straight-line distance across red, green and blue, so colorkey=fff&colorkey-tol=20 keys white and colors such as f5f5f5 (17 away), but not eeeeee (29 away). In chroma mode it is measured on color alone, ignoring brightness.

The default is 20 in color mode and 54.09 in chroma mode. Raise it to catch uneven lighting or JPEG noise in the background. Lower it when parts of the subject close to the key color start to disappear.

colorkeytol is accepted as an alias.

colorkey-tol=5
sandbox-demo
colorkey-tol=60 starts removing the dark background
sandbox-demo