Design and Social Media

Pixel Sorting Explained: How to Make Glitch Art from Photos

What pixel sorting is, how thresholds, angles and masks control the effect, and how to make striking glitch art and animated GIFs from your photos.

Saizul Amin
Saizul Amin2 Nov 2026 · 4 min read
Pixel Sorting Explained: How to Make Glitch Art from Photos

Pixel Sorting Explained: How to Make Glitch Art from Photos

Pixel sorting produces some of the most recognisable images in glitch art: faces and landscapes that seem to melt into streams of colour while parts of the picture stay crisp. It looks chaotic, but it follows a simple and controllable process. Once you understand that process, you can decide exactly what melts and what stays. This guide explains the idea and walks through the controls of the free Pixel Sort Studio.

The basic idea

A digital photo is a grid of pixels, each with a colour. Pixel sorting takes a stretch of pixels along a row and rearranges them in order of some value, usually brightness, from darkest to lightest. The colours in that stretch are still the same colours, just in a different order, so the original palette of the photo survives while its shapes dissolve into gradients.

If you sorted every row completely, the whole photo would become horizontal gradients and lose all structure. The art is in sorting only some stretches. That is the job of the mask.

Threshold masks

The most common mask is a brightness window. You set a lower and an upper value, and only pixels whose brightness falls between them can be sorted. Wherever such pixels form an unbroken run along a row, that run is sorted. Very dark and very bright pixels act as walls that stop the sorting. In a portrait against a bright sky, a window that excludes the brightest values lets the face smear while the sky stays clean, or the reverse if you invert the mask.

Sorting by hue or saturation instead of brightness changes the character completely. Hue sorting arranges colours around the colour wheel and tends to create rainbow banding, while saturation sorting pushes grey tones to one end and vivid ones to the other. Turning on the mask preview before committing is the fastest way to learn how each key behaves on your photo.

Intervals and randomness

Using full runs gives long, smooth streaks. Breaking each run into random lengths up to a maximum gives a choppier, more broken texture, a bit like a damaged video signal. Sorting whole lines ignores thresholds altogether, which is mostly useful together with a painted brush mask.

Direction and angle

By default sorting happens along rows, but nothing says it has to. Turning the angle to 90 degrees sorts downward along columns, which creates the dripping look that made pixel sorting famous. Diagonal angles create a sense of motion, as if the image is being pulled sideways. Reversing the order sends light pixels to the other end of each run, which flips the direction the streaks appear to flow.

Painting the mask by hand

Thresholds are global: they apply everywhere the brightness matches. Sometimes you want the effect only on part of the picture, for example the hair but not the eyes, or a single building in a skyline. A brush mask solves this. Paint the areas where sorting is allowed, switch the brush mask on, and everything outside stays untouched regardless of the thresholds. Combining a brush mask with a threshold window gives the most precise control.

Working with resolution

Sorting is computed pixel by pixel, so larger images take longer. The studio previews on a smaller copy so sliders feel immediate, then applies the same settings to the full photo when you export. Settings are scale independent; the streaks in the export cover the same relative distances as in the preview.

Animating the effect

A still sorted image is striking, but watching the sort happen is even more so. The animated GIF export starts with the original photo and sweeps the sorting across the picture row by row, then holds on the result. It makes a good profile animation or post, and it shows viewers what the technique does.

Ideas to try

Sort a night street by brightness at 90 degrees with a window that excludes the brightest lamps, so the lights stay as points above melting reflections. Sort a flower close-up by hue with random intervals for a woven texture. Paint a mask over only the background of a portrait and sort it at 0 degrees, so the person seems to rush past. Invert the mask on a high-contrast black and white photo to smear the shadows instead of the highlights.

A note on originals

Pixel sorting is destructive: once exported, the original order of the pixels is gone. Keep your original photo and treat the sorted version as a new piece. Everything in the studio runs in your browser, so you can experiment freely without uploading anything.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages