Pixel Sorting Explained
From a 2010 Processing experiment to one of the defining looks of contemporary glitch art — how pixel sorting actually works, and how to use it.
Where pixel sorting comes from
Pixel sorting was popularised around 2010 by German artist Kim Asendorf, who wrote a Processing sketch that sorted image pixels by brightness within a threshold range. The result was striking: parts of the image stayed intact while other parts "spilled" into flowing streaks of color.
Within a few years the technique had spread through generative art communities, then into album art, editorial illustration, music video aesthetics, and — by the mid-2020s — into mainstream Y2K-revival graphic design.
How the algorithm works
The core idea is simple:
- Walk through each row (or column) of an image.
- Find segments of pixels matching a threshold — for example, "all pixels with brightness between 25% and 85%".
- Sort each segment by a chosen key (brightness, hue, saturation, or a single color channel).
- Pixels outside the threshold stay in place.
That "stays in place" part is what makes pixel sorting recognisable. The brightest highlights or darkest shadows hold their position while the midtones stream past them, producing the iconic flowing-streak effect.
Sort keys and what they do
- Brightness — the classic streak look. Pixels flow dark to light. Best starting point.
- Hue — rainbow bands. Pixels reorder by color wheel position.
- Saturation — gray-to-color gradient. Emphasises color richness.
- Lightness — similar to brightness but uses HSL lightness instead of luminance.
- R / G / B channel — surreal color shifts when a single channel dominates the sort.
Threshold tricks
The threshold range is the artist's main creative control. A few common tactics:
- Sort the bright parts — threshold low 60%, high 100%. Highlights spill, shadows stay sharp.
- Sort the dark parts — threshold low 0%, high 30%. Shadows streak, highlights remain crisp.
- Sort the midtones — low 25%, high 75%. Both extremes hold, only the middle flows.
- Sort everything — threshold mode "none". Maximum chaos, often used at low resolution as background texture.
Chunky vs flowing
By default sorts span entire continuous segments — a bright streak can run hundreds of pixels long. STUDIO·ITY's segment max length slider breaks streaks into chunks. Lower values give a more digital, "corrupted" look. Higher (or unlimited) values give the classic Asendorf flow.
Combining with other effects
Pixel sort plays well with other glitch / retro effects in the STUDIO·ITY suite:
- Pixel sort + RGB shift — chromatic aberration adds extra digital decay. The tool has built-in RGB shift; pair it with your sort.
- Pixel sort + halftone — sort first, then halftone for a print-meets-glitch poster look.
- Pixel sort + ASCII — sort the image, then convert to ASCII for terminal-aesthetic.
- Pixel sort + dither — sort then dither for full Y2K corrupted-CD-ROM vibes.