← Iris

Canvas
Sort by
Direction
Threshold low 0.15
Threshold high 0.85
Speed 8

Pixel sorting as an art form

Pixel sorting emerged in the early 2010s as a generative art technique, popularized by artist Kim Asendorf whose Processing sketch went viral and spawned an entire aesthetic movement. The idea is simple: take a row (or column) of pixels and sort them by some property — brightness, hue, saturation, or any computed value. The result transforms photographs and images into something that looks like a controlled malfunction, with streaks of color flowing like liquid through the composition. The technique sits at the intersection of algorithm and aesthetics: the sort function is deterministic, but the visual effect feels organic and unpredictable.

The role of thresholds

What makes pixel sorting visually interesting rather than just a blurry mess is the threshold. Instead of sorting an entire row, the algorithm identifies contiguous runs of pixels whose brightness (or other property) falls within a range. Very dark and very bright pixels act as anchors — they stay in place while the mid-tones between them get sorted. This creates the signature glitch-art look: recognizable structure in the dark shadows and bright highlights, with smooth sorted gradients sweeping through the middle values. Adjusting the thresholds changes the character of the effect dramatically. Low thresholds produce subtle shifts; wide thresholds produce long dramatic streaks.

From glitch to gallery

Pixel sorting belongs to a broader family of databending and glitch art techniques that deliberately introduce errors or reinterpretations into digital media. Other techniques include opening image files as raw audio, editing JPEG headers to corrupt compression blocks, or circuit-bending hardware to produce visual artifacts. What distinguishes pixel sorting is its mathematical elegance: it applies one of the most fundamental operations in computer science — sorting — to visual data, revealing hidden structure in color distributions. The sorted runs expose the palette of an image in a way our eyes rarely perceive, turning a computational primitive into something genuinely beautiful.