Forums > Jitter

Scrambled picture : is noise from a given matrix possible ?

September 11, 2013 | 9:36 am

Hi there,
I’m having some trouble achieving something apparently simple. I want to randomly distribute all the pixels in each row of a given matrix and get a « noisy » version of an image or video. To put it in simple words : is it possible to make something similar to noise but with a given number of predetermined cell values ? Like a puzzle-matrix in which each cell is a movable piece ? (The « only rows » option is just to give the result some consistancy compared to the original)
To be more explicit, here’s a patch showing the two roads I’ve tried to go so far. Both are very straight forward but none is satisfying. Route one works well but takes loooots of time analysing the incoming matrix pixel by pixel. So definitely not realtime instant result…
Route two uses jit.iter and works fine with a simple tiny 1 char matrix but it’s another story when it comes to image-size data…

I feel like I’m using my computer like a 19th century steam engine with these examples. There must be some more clever solution out there.

One last thing : I checked the jit.sprinkle object and its gl.pix equivalent. They give interesting results but somehow, I can’t tweak them to get something looking as random as I want.
Any hint ?

Thanks !

<code>

– Pasted Max Patch, click to expand. –

</code>


September 11, 2013 | 11:55 am

jit.repos. Orig. matrix in the left inlet, and a [jit.noise 2 char your-x-size your-y-size] in the right.


September 11, 2013 | 12:02 pm

hey
you’d rather use jit.repos :
<code>

– Pasted Max Patch, click to expand. –

</code>
this is simple wiht noise, but all the original cells won’t necessarly be used. I tried to make a cell map that ensures all the original cells are re used, but it doesn’t really work…
<code>

– Pasted Max Patch, click to expand. –

</code>


September 11, 2013 | 12:03 pm

hah wetterberg, ninja’d :))


September 11, 2013 | 1:04 pm

hehe, well you did the good work with patches and all, so you’re still ahead :)


September 12, 2013 | 9:16 am

Ooops… Jit.repos… I guess i should have rtfm better… I’ve used this object only for simple translation so far.
Thanks to both of you anyway, and for your information, the trick works even better using the td.repos.jxs shader.
Cheers !


September 13, 2013 | 3:24 pm

(hey, could you tell us if you achieved like scrambling the position of all pixel, without losing one ? and how, if it was with jit.repos ? i’m curious !)


September 14, 2013 | 2:56 am

Well the repos shader works perfectly fine for my ongoing little project. At least visually because I doubt the output contains the exact same pixels as the input. As I’m curious too, I tried this repos method with very small matrices so I can see, count and compare pixels before and after. The output seems to be more like an interpretation than a new combination of the same data.

It’s visually satisfying on large matrices like regular video footage. I guess the large amount of pixels gives a good enough average noisy recombination but it feels a little bit like a telepod in Cronenberg’s "The Fly" : the output looks the same but you don’t know how it’s been reinterpreted…


January 8, 2014 | 7:47 am

Apologies for cross-posting, but I’ve been faced with a similar issue of trying to scramble cells in a matrix whilst preserving every individual cell value, and on another thread I was pointed in the right direction – I’ve also posted a small patch which does the job on matrices up to 256×256 in dimension. Hope this might be useful to somebody searching in the future.

http://cycling74.com/forums/topic/shuffle-matrix-cells-any-ideas/#post-277737

Cheers

Tom


Viewing 9 posts - 1 through 9 (of 9 total)