Databending - Convert raw data into image

grigou's icon

Hello,

I want to do databending with Jitter, but I can't find an efficient way to do it.

I made some images by opening raw files in Photoshop and I want to do the same with Jitter.
I made the file "raw_example.jpg" with Photoshop, and it's exactly this kind of visual I want to achieve with Jitter.

I try to open raw files with sfplay and convert it into image with jit.catch and jit.gl.texture, but the result is not even close to what I made with Photoshop.

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

Any idea ?
Thanks !

raw_example.jpg
jpg
grigou's icon

Hello,

I'm still stuck with my raw data conversion. Any clues ?
Is there another way to achieve raw data conversion in Max like the one I made with Photoshop ?

Thanks again for your help !

metamax's icon

This reminds me of something I built by saving each row of a matrix in an audio buffer and playing them back with spectrocope~ in sonogram mode.

grigou's icon

Hello Metamax !
Thanks for you help.

Your matrix was generated by an audio file at first or you created a random matrix ?

Holland Hopson's icon

I got your patch to work by adding a toggle to jit.world. Changing the framesize attribute of jit.catch~ provided some nice variety.

Dario's icon

this patch rules!

grigou's icon

Thanks Holland Hopson.
Using the toggle on jit.world was so simple and clever that I didn't even think to do it !

For now, the result is too much clean. I want something more noisy / dirty like the one I made with Photoshop.
And with jit.gl.videoplane, it's very blurry and ugly.

I'm pretty sure that the resolution is too low, so I increase the dim attribute. It look likes less blurry, but with a huge drop of framerate.
Is it possible to keep hi resolution in fullscreen without losing too much FPS ?

With Photoshop, I can made fixed images, but my will is to make an evolving texture with Max keeping the same noisy visual.
Maybe jit.catch~ is not the good tool for that purpose ?

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

This is the new patch :

Rob Ramirez's icon

you could try throwing a jit.scanwrap in there and playing with different dimension values, also try disabling gl.texture filtering (@filter none):

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

grigou's icon

Thank you Rob ! It's perfect !
I didn't know jit.scanwrap and the filter attribute.

yaniki's icon

That's a nice topic.

I also rebuilt a bit the previous patch. It's just a sketch, but maybe my method will be useful for dealing with bigger textures.

databendingtotex.maxpat.zip
zip
grigou's icon

Woo !!

Your patch is so great !
Thanks a lot for sharing. I love the visual.
I will study this patch to understand how you made it.

Thank you again

Yoann's icon

oh, I just wanted to bring this post up to see if someone had some new ideas to bring in ;)

grigou's icon

Haha ! Thanks Yoann !
Yeah, there's always a lot of fun to do with glitch and databending !

yaniki's icon

Yeah... I should definitely do something new...

jeff trupiano's icon

I have been looking for a way to databend video with audio for a long time. This is what chat gpt gave me but when I paste it to text in Max it doesn’t become a patch. I’m sure there’s an easy solution or correction to the AI script but I haven’t used Max in a couple of years since I have an academic I’m in touch with who makes stand alone video processors, but nothing like this:

openpanel]
     |
[jit.qt.movie @autostart 1 @loop 1]  <-- Load any video
     |
[jit.qt.movie] -> [jit.rgb2luma] -> [jit.matrix 4 float 640 480]  <-- Convert to matrix for processing
     |
     |-----------------------------
     |                             |
[jit.op @op - @val 1.0]      [jit.slide @slide 0.2]   <-- Inversion and feedback (echo-like)
     |                             |
     |------------[jit.op @op @val 1.0]  <-- Combine effects
                   |
                 [jit.expr "x
sin(t*10)+y*cos(t*10)"] <-- optional audio-style modulation (oscillator)
                   |
             [jit.matrix 4 float 640 480]  <-- Output processed matrix
                   |
               [jit.window @size 640 480]  <-- Display output in real-time
                   |
               [jit.qt.record @autostart 1 @overwrite 1] <-- Optional: save output video

Also given:

Wil's icon
This is what chat gpt gave me but when I paste it to text in Max it doesn’t become a patch.

Haha. Go chatGPT!

//

first message (openpanel) not even a message for jit.qt.movie

//

here is code for first 2 objects

{

"boxes" : [ {

"box" : {

"maxclass" : "message",

"text" : "read",

"patching_rect" : [ 604.0, 77.0, 33.0, 22.0 ],

"id" : "obj-11",

"numinlets" : 2,

"numoutlets" : 1,

"outlettype" : [ "" ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "jit.qt.movie @autostart 1 @loop 1",

"patching_rect" : [ 604.0, 119.0, 186.0, 22.0 ],

"id" : "obj-9",

"numinlets" : 1,

"numoutlets" : 2,

"outlettype" : [ "jit_matrix", "" ]

}

}

],

"lines" : [ {

"patchline" : {

"source" : [ "obj-11", 0 ],

"destination" : [ "obj-9", 0 ]

}

}

],

"appversion" : {

"major" : 9,

"minor" : 0,

"revision" : 9,

"architecture" : "x64",

"modernui" : 1

}

,

"classnamespace" : "box"

}

copy/paste into max

looks like this

//

I will build that chatGPT and see if it work

//

edit: as is, nope

jeff trupiano's icon

Thanks for your efforts!! Any way you could see audio effects applied to video as video effects? It works in audacity but through many steps without a preview etc. AI has convinced me this is possible and waveforms like in synesthesia software modify the image so why shouldn’t audio effects?

Roman Thilenius's icon

most simple should be: convert average value per color channel and apply some functions to it as signal. make sure that you use functions which are not already common for image editing already. if video was 8 bit, interpolate to float resolution. and of course interpolate frames to SR.

jeff trupiano's icon

Thanks greatly as I never got systematic enough to learn to design in Max. Anyway might you give this Jitter project a try and attach it here? Would love to flesh out this experiment by someone who knows what they are doing