Imgix APIsRendering APIStylizeThreshold

Threshold

threshold

The threshold parameter reduces an image to pure black and white. Every pixel whose brightness is at or above the cutoff becomes white, and everything below it becomes black. Use it for stencils, screen-print separations, high-contrast poster art and 1-bit output.

threshold accepts a value from 0 to 100, with decimals allowed. The value is the brightness cutoff as a percentage, so threshold=50 splits the image at the midpoint. Lowering the cutoff keeps more of the image white; raising it keeps more of it black. Values outside the range are clamped. threshold=0 puts every pixel at or above zero brightness on the white side, which turns the whole image white.

Non-numeric values are ignored and left out of the X-Imgix-Params response header.

Transparency is preserved: transparent pixels stay transparent rather than becoming black.

Original image
sandbox-demo
threshold=50 splits the image at the midpoint
sandbox-demo

Dithering

A hard cutoff loses all of the midtones. threshold-dither replaces the hard cut with a dot pattern that approximates them, which is what most print and retro-styled work wants. It only applies when threshold is also set.

Order of Operations

threshold is applied after gradient-map and the tonal adjustments, so those change where the cutoff lands. mark, txt and blend layers are drawn afterwards and keep their own colors.