## Scrambled picture : is noise from a given matrix possible ?

Sep 11, 2013 at 9:36am

# Scrambled picture : is noise from a given matrix possible ?

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>

#265000
Sep 11, 2013 at 11:55am

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

#265019
Sep 11, 2013 at 12:02pm

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>

#265021
Sep 11, 2013 at 12:03pm

hah wetterberg, ninja’d :))

#265022
Sep 11, 2013 at 1:04pm

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

#265025
Sep 12, 2013 at 9:16am

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 !

#265114
Sep 13, 2013 at 3:24pm

(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 !)

#265236
Sep 14, 2013 at 2:56am

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â€¦

#265256
Jan 8, 2014 at 7:47am

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

#277738

You must be logged in to reply to this topic.