"Pixel Sorting" Need help with this technique.

alex74 74's icon

Hi guys! I am trying to recreate an effect that I've seen and would like to explore/expand this idea even further. I'm hoping you guys can point me in the right direction.

Still images here:

Are there any readymade example that I can jump into and explore?

Is there an actual name for this technique?

Thanks in Advance!!!!

Andro's icon

Check the jit.gl.slab td.repos example ( i think )
You could make a black and white streak picture in photoshop and feed that via jit.matrix into the rightmost inlet of the slab object. Use jit.op @op * to make the effect stronger. You could also run it through another td.repos effect to make it scroll down.

phiol's icon

Hi Alex74

Max Patch
Copy patch and select New From Clipboard in Max.

reminds me of this cool andrew benson patch
I've include the thread link inside the patch.

Matteo Marson's icon

Hi!
This is my pixel sorting patch. You need Bach external library in order to use it.
I'd love to port this patch into a shader, in order to use it in or close to real time with videos, so if anyone have an idea of how to do it is very welcome!

Max Patch
Copy patch and select New From Clipboard in Max.

2K's icon
Matteo Marson's icon

Thanks 2K for the reply!

I already saw that link, and that's a very cool patch, but what i'm trying to achieve is slightly different. In that patch the sorting occours trought feedback iterations, and while visually charming, i can't really grasp the sorting criteria very well.

Attached there're some results from my patch, just to better visualize what i talking about

The alghorithm goes like this:

1) Take an image
2) Each raw (or column in case of vertical sorting) is analyzed pixel by pixel
3) for each raw i consider all the values above a certain treshold
4) Those points define regions in which i take all the contained pixels and sort them indipendently from the rest of the image
5) Output the result

The whole process occours as a single operation (even if, of course, in its core the sorting process requires iterations)
What i'd like to do, is to port this process onto the GPU,
What i don't fully understand is if it's possible to iterate trought a texture in "array form" into jit.gl.pix.

sorted-jitter-20.jpg
jpg
sorted-jitter-181.jpg
jpg