Utilora

Pixel Sort — Glitch Art from Any Photo

Image Tools

What is Pixel Sort — Glitch Art from Any Photo?

Pixel Sort is a creative-coding technique that turns a photo into glitch art by sorting runs of pixels along each row or column by some key — usually luminance or hue. The signature look (smeared color streaks broken by sharp untouched regions) comes from sorting only the pixels above a threshold, leaving everything else untouched. Originally popularized by Kim Asendorf, pixel sort is now a staple of generative and glitch art.

How it works

For each row (or column, depending on direction), the algorithm walks pixels and identifies contiguous runs where the sort key exceeds the threshold. Each run is sorted in place by its key (and optionally reversed). The result writes back into a fresh ImageData buffer. The implementation runs on CPU because the variable-length run boundaries are inherently sequential per row; full-image sort completes in tens of milliseconds for typical web images.

Features & Benefits

  • Real-time pixel-sort glitch effect with five sort keys (luminance, hue, R, G, B)
  • Horizontal and vertical modes
  • Threshold and reverse controls let you tune the effect from subtle to extreme
  • Export the result as a PNG; nothing is uploaded

Frequently Asked Questions

Why does pixel sort look the way it does?

Because only pixels above a threshold are sorted, you get smeared streaks where bright/dark regions get rearranged, and untouched islands where the threshold isn't crossed.

Why is this in the WebGPU batch if it runs on CPU?

The sort itself is inherently sequential per row, so CPU is the right tool. We bundle it with the WebGPU tools because it lives in the same 'image art' category and shares the same no-upload story.

How big an image can it handle?

Tested comfortably on 4K images. Very large captures may take a second or two; sliders feel snapper on web-resolution photos.

Is my photo uploaded?

No. Decoding, sorting, and PNG encoding all run in your browser.

Related Tools

Popular Utilities