← Back to blog

What Is Pixel Sorting? A Complete Guide

Learn what pixel sorting is, how it works, and why Kim Asendorf's algorithm became the most viral glitch art effect. Explore brightness, hue, and threshold modes.

Pixel-sorted photograph with streaks of sorted color values creating a glitch art effect

Sometime around 2010, digital artist Kim Asendorf created a processing script that would become one of the most viral glitch effects in digital art: pixel sorting. The technique treats a photograph like a sequence of colored elements, sorts them by brightness or hue, and rearranges them into a new pattern. The result is mesmerizing, hypnotic, and instantly recognizable.

The Genius of Pixel Sorting

Here's what makes pixel sorting so visually striking: it preserves all the original color information from your image, but rearranges it according to a sorting rule. A face might become a smear of color gradients. A landscape becomes abstract ribbons of tone.

The algorithm works like this:

  1. Define a threshold (e.g., "pixels darker than X" or "pixels within hue range Y")
  2. Identify continuous segments of pixels that match the threshold
  3. Sort each segment by a property: brightness, hue, saturation, or luminance
  4. Place the sorted pixels back into the image

Why It Works So Well

Pixel sorting is visually striking because it creates unexpected patterns. Our brains are wired to find structure in images, and pixel sorting creates structure that's partially recognizable - you can still sense the original image, but it's been transformed into something dreamlike.

The effect also creates chromatic streaks where colors blend and merge. A gradient runs through the image in unexpected directions, creating a liquid, flowing quality.

Kim Asendorf and the Glitch Art Movement

Kim Asendorf's original processing script became the template for pixel sorting. The technique exploded in the early 2010s as part of the broader glitch art movement - artists celebrating digital artifacts, corrupted data, and broken algorithms as aesthetic choices.

Glitch art rejected the idea that digital art should be "perfect." Instead, it embraced errors, compression artifacts, and breakdowns as source material. Pixel sorting fit perfectly into this movement.

Variations and Evolution

As pixel sorting became more popular, artists developed variations:

  • Brightness-based sorting: Creates dark-to-light gradients
  • Hue-based sorting: Arranges colors in rainbow sequences
  • Vertical sorting: Applies the effect column-by-column instead of row-by-row
  • Threshold masking: Sorts only certain colors, leaving the rest untouched
  • Multiple passes: Apply sorting multiple times with different thresholds

From Underground Art to Mainstream

By the mid-2010s, pixel sorting had gone mainstream. Instagram was flooded with pixel-sorted portraits. Music producers used it for album covers. Fashion brands used it in advertisements. The effect that started as an experimental processing script became a visual language.

It's a perfect example of how technical knowledge (understanding sorting algorithms) combined with artistic vision creates something powerful.

Pixel Sorting Today

While the initial hype has cooled, pixel sorting remains a staple effect for anyone exploring glitch aesthetics. It's sophisticated enough to feel artistic but simple enough that anyone can apply it and get good results. The barrier to entry is basically zero.

Ready to try it? Open GlitchArt Studio and experiment with this effect.

Try this effect in GlitchArt Studio 85+ effects, real-time preview, free to use
Open Editor