Pixel Sorting in After Effects: The Real Video Glitch Method
The real way to pixel sort video in After Effects: a plugin or frame-export workflow, not the Photoshop Wind filter trick.
01/ ARTICLE
What Is Pixel Sorting, Really?
Pixel sorting reorders a run of pixels along a row or column by some property, usually brightness, rather than corrupting the underlying file. Set a threshold, and the tool picks intervals of pixels that fall inside it, then sorts each interval by that property. The result: the familiar melted, dragged streak look.
That's a different mechanism from datamoshing, and it's worth separating the two clearly, because they get lumped together constantly. Datamoshing works on the video's compressed structure. It removes an I-frame — a full, independently decodable frame — and leaves the P- and B-frames that follow, which only store motion data relative to a previous frame. No valid reference frame means that motion data gets applied to the wrong base image, and you get the smeared, melting look most people actually mean when they say "glitch video" (Wikipedia, Glitch art). Pixel sorting never touches the codec at all. It just operates on pixel values in one decoded frame, whether that frame came from a video or a still photo.
The confusion makes sense. Both produce a similar broken-video aesthetic, and both end up filed under "glitch art" by anyone who hasn't built one or the other by hand. Once you know the mechanism, "how do I pixel sort a video" stops sounding like "how do I datamosh a video" — and the real answer gets a lot more specific.
Why the Photoshop Wind Trick Doesn't Get You Video
If you've searched this before, you've probably hit the Photoshop Wind-filter method: rotate the image 90 degrees, run the Wind filter (Stagger works best) a few times, rotate it back. You get horizontal streaks that read as a pixel sort without actually sorting anything. It's a legitimate, fast still-image technique — we cover it in full on the Photoshop side of this series.
But it's a still-image trick, full stop. Wind smears pixels in a fixed direction based on contrast edges in a single frame. It has no concept of "the next frame," and no way to hold that smear consistent across a sequence. You could run it on every frame of an exported video by hand — technically possible — but that's not a video workflow. It's a few hundred manual repetitions of a still-image filter with zero guarantee of continuity between them. Closing that gap is the point of this article: a method built for video from the start, not a still-image filter borrowed for a job it was never designed to do.
The Real Method: Frame-by-Frame Pixel Sort for Video
Two paths actually work in After Effects, and they trade off the way most plugin-versus-manual choices do: setup cost against control.
Native plugin. A compiled After Effects plugin runs the sort inside AE directly, on your timeline, without ever leaving the app. The meatbags pixel-sorting-ae project is a working example — built specifically for AE rather than adapted from a still-image tool — so the sort applies to your footage as an effect in the stack, same as anything else.
Export, sort, reimport. The more common path outside AE-native tooling: export your clip as a frame image sequence, run a per-frame pixel-sort tool across every frame, then bring the sorted sequence back in as an image sequence layer. Tools built for exactly this, like the OpenCV-based PixelSorting project, load the video, sort each frame independently by whatever property and threshold you set, and write the sorted frames back out. That output drops straight into an AE composition as an image sequence.
Neither path wins outright. Pick based on what you're actually optimizing for:
| Native AE plugin | Export / sort / reimport | |
|---|---|---|
| Setup effort | Install once, use like any effect | Round trip through an external tool every time |
| Control over settings | Whatever the plugin exposes | Full access to the underlying tool's parameters |
| Works on any clip length | Yes, timeline-native | Yes, but no checkpointing on long renders — an interrupted run loses progress |
| Output file size | Normal AE render | Can be much larger; OpenCV-based writers commonly re-encode to .mp4 regardless of your source format |
| Best for | Fast iteration inside an existing AE project | Squeezing out settings a plugin doesn't expose |
Already deep in an AE timeline and just want the effect without leaving the app? Start with the plugin. Need finer control over threshold and sort direction than a plugin gives you? The frame-sequence route gets you there, at the cost of a slower loop.
Settings That Actually Change the Look
Whichever path you take, three settings do almost all the work.
- Threshold. Most tools that expose this run somewhere in the 0.25 to 0.8 range. Lower thresholds sort more of the frame and read as heavier, more chaotic; higher thresholds sort narrower, brighter slivers and read as more surgical. Start around 0.45–0.5, then adjust once you've seen your footage respond.
- Sort key. Brightness is the default and the most predictable starting point. Sort by a different channel or HSB value instead, and you get a different character of streak — same mechanism, different flavor.
- Angle. Don't assume horizontal or vertical are your only options. A 45-degree sort angle (or whatever angle a given tool exposes) changes the direction the streaks pull in, and that matters a lot on footage with strong horizontal or vertical structure already in frame.
Run the same source frame through a couple of threshold values side by side before committing to one for the whole clip. A 0.3 pass and a 0.7 pass on identical footage read as two different effects, not two intensities of the same one.
The Flicker Problem
Here's the failure mode nobody mentions until they hit it: frame-by-frame pixel sorting on video flickers, even on footage that barely moves. The reason is structural, not a settings mistake you can dial out. Each frame gets sorted independently, with no shared state between frames — so the exact pixels that fall inside your threshold, and the exact interval boundaries the tool draws, shift slightly from one frame to the next, even when the underlying image is nearly identical (Processing Forum, "Pixel Sort video"). The streaks don't hold still. They crawl.
None of the tools discussed here carry sort state across frames, so there's no clean settings fix — the jitter is part of the aesthetic you're signing up for, not a bug. Two things help in practice: footage with genuine motion hides the frame-to-frame jitter far better than a static shot, where it reads as unwanted noise. And gentler, more gradual parameter values make the shift feel less jarring shot to shot. Need a perfectly stable sorted look? This frame-independent approach isn't the tool for it. You're either choosing pixel sorting for the crawl, or you're choosing a different effect.
Frequently Asked Questions
Is pixel sorting the same as datamoshing?
No. Datamoshing corrupts video codec structure by removing I-frames so P/B-frames apply motion to the wrong base image. Pixel sorting reorders pixel values within a frame by a property like brightness. They look superficially similar but come from entirely different mechanisms.
Can I pixel sort a video directly in After Effects with no plugins?
Not with a single native effect. The two real paths are a compiled AE plugin, like the meatbags pixel-sorting-ae project, or exporting a frame sequence, running a still-image pixel-sort tool on every frame, and reimporting the sequence.
Why does my pixel-sorted video flicker even on static footage?
Frame-by-frame tools sort each frame independently with no shared state between frames, so the sorted interval boundaries shift slightly frame to frame, even when the source footage barely moves. That jitter is the single biggest tell of the frame-sequence method.
What threshold should I start with for a video pixel sort?
0.25 to 0.8 covers most usable results in the tools that expose it, with brightness as the default sort key. Start near the middle of that range and push toward the edges once you see how your footage responds.
Does the Photoshop Wind filter work for video pixel sorting?
No. It approximates a pixel-sort look on a single still image only. There's no way to extend it to video without reprocessing every frame by hand, which is exactly the workflow this article replaces with an actual pixel-sort tool.
Conclusion
The real video pixel-sort method isn't a still-image filter run in a loop. It's a frame-by-frame sort built for the job, either as a native After Effects plugin or an export/sort/reimport pass through a dedicated tool. Threshold, sort key, and angle are your three real controls, and the flicker you'll see on static shots is structural — not a mistake you made.
Want to see the settings on your own footage before committing to a full render? Try pixel sort live in kott with the effect preloaded.
02/ OUT
Every setting described above is a real control. Open your own image and sweep it.
All journal entries